Blogs Overview
Features
- Module provides the ability to easily create and manage multiple blogs in the CMS, which enables users to easily link to other resources (pages, articles, media items, etc.) in blog posts
- API ability to pull a user-defined blog description, header image, & unique display template
- API ability to filter blog posts by category, month, tags, & author
- Feeds: a RSS feed is generated for each blog in the CMS. your-blog-slug-here.xml will be published to the media folder of your site every time a blog post / blog is edited or created.
How do I create a blog?
Navigate to Content > Blogs This will take you to the blog post page. Before you write a post, you will need to setup a new blog. Click blogs.
Then click the 'Add Blog' link on the right site. The only mandatory field is the title. The 'Default' display monklet will suffice for most situations.
How do I add an entry?
Under Content > Blogs click 'Add a New Blog Post'. Give it a title and select which blog it will belong to. If a summary is not added, the beginning of the post will be used. When you are done make sure that it is published.
How do I get my blog to display on my web site?
Nothing! well.. almost...
By default blogs will use the monklet 'All Blogs'. As soon as you have created a blog and written one post for it, you can view the blog on your site. Navigate to: http://www.yoursite.com/blog-slug/.
It's a good idea to create your own default monklet since you will probably want to customize the output. Simply go to Content > Monklets and open 'All Blogs. Click 'Copy' and then edit the new monklet to your heart's content. Set the 'Site Display Default:" to be used for all blogs for your site.
How to I create a list of Authors/Categories/Months/Recent Entries?
The following monklet will display a <ul> (unordered list in html) for all categories for a blog. Each category will link to http://www.yoursite.com/blog-slug/category/category-slug. You will not need add any additional parameters to the monklet so it will know to look for the category.
Example: (actual monklet requires two brackets to open and close)
tag="blog"
display="list"
name="blog-slug"
groupby="category"
Which will produce (from http://www.ekklesia360.com/ekklesia-360-blog/, styling will be dependent on your site):
Other options are:
group_by:author
group_by:month
group_by:recent (displays the last 5 posts)
How do I display a list of authors with more information?
Viewing /blog-slug/authors/ will display a list of authors with a little more info for each author.
Example: (actual monklet requires two brackets to open and close)
show_authorlist="<h4 style='clear:both'>__blogauthor__</h4>"
show_authorlist="<p>Posts: __blogauthorcount__</p>"
show_authorlist="<p><img src='__blogauthorimage__' alt='__blogauthor__'>"
show_authorlist="__blogauthorbio__"
show_authorlist="</p>"
show_authorlist="<p><a href='__blogauthorURL__'>View __blogauthor__'s Posts</a></p>"
For an example visit http://www.acts29network.org/acts-29-blog/authors/
Author's bio and image can be set by editing their account and clicking the 'Edit Profile' link.
How do I add a tag cloud?
Just add the following monklet to any page or section. Actual monklet requires two brackets to open and close.
tag="blog"
display="cloud"
name="blog-slug"
tagmin="2"
This will produce a tag cloud similar to the one on Sermon Cloud. Each anchor will have a class that corresponds to how relevant it is. For instance if a tag had only been used with two entries it would have the class tag0. The following css can be used to format the tags.
<style type="text/css">.tag0 {font-size: 10px;}
.tag1 {font-size: 12px;}
.tag2 {font-size: 16px;}
.tag3 {font-size: 21px;}
.tag4 {font-size: 26px;}
.tag5 {font-size: 30px;}
.tag6 {font-size: 32px;}
.tag7 {font-size: 34px;}
#cloud a{text-decoration: none;}</style>
Each tag will link to /posts-about-tag-slug/. You will to need to add the following line at the end of your htaccess file (see article: how to add custom htaccess on monkcms sites) and then create the template mcms_blogtaglist.php.
rewriteRule ^posts-about-([^/]+)/?$ /mcms_blogtaglist.php?tag=$1 [NC,L,QSA]
You will need to add the following line at the top of the page on the template which will be displaying this tag cloud:
$tagSlug=$_GET['tag'];
Then add the following getContent to the body:
getContent(
"blog",
"display:list",
"name:blog-slug",
"find_tag:".$tagSlug,
"show_postlist:<h4>__blogtitlelink__</h4>"
);
This getContent will grab a list of blog posts that match the tag that is being requested.
How do I display a list of recent blog posts?
Below is an example getContent that will return a list of recent posts. Using the slug version of the blog name "my-example-blog" will display posts from a specific blog and using "all" will display posts from all site blogs.
getContent(
"blog",
"display:list",
"name:my-example-blog",
"order:recent",
"howmany:5",
"show_postlist:<h4><a href='__blogtitlelink__'>__blogposttitle__</a></h4>"
"show_postlist:<p>"
"show_postlist:posted on __blogpostdate format='M d, Y'__"
"show_postlist: by __blogauthor__"
"show_postlist:</p>"
"show_postlist:<p>__preview limit='120'__</p>"
);