Posted by James Kanjo on 09 Dec 2008 23:04, last edited by Helmut_pdorf on 01 Jun 2015 05:41
With the recent development of the ListPages module, the Wikidot engine has become very powerful, and is now able to provide new automated functionalities. One of these functionalities include the ability to create fully functional blogs.
Table of Contents
You will need a…
- category to store all blog entries in;
- live template to automate display formatting of new entries;
- page to display the latest blog entry;
- page to display all blog entries (for RSS feeds).
Step 1: Create a category
You will need to create a Category to store all blog entries in. The "Category" you create is really nothing more than a new page except it becomes a "home" or top level page for the rest of the blog's supporting "sub-pages" to "fall out of" or be attached to as you create them. The details are covered down in Step 2, below.
In this how-to, we will use the "blog" category. Now you have two options as to how you will store your blog entries:
- Name given URLs (i.e. blog:great-food, blog:fun-swimming, etc, etc.);
- Sequentially numbered URLs (i.e. blog:1, blog:2, etc, etc.).
There are no 'side-effects' to either method, so whatever you choose will have no affect on the rest of your blog. The only difference is that you may want a 'more ordered' blog with automatically numbered entries. However; you need to perform some extra steps if you choose option 2.
Category Creation Steps
- At your home page, create a new page by filling out the "New Page" entry block and click, "New Page". Keep the exact spelling of that new page in mind.
- A new page will be created and you will be taken to it in the "edit" mode.
- Make whatever changes you want to initially make to the new page and save it using the "Save" button at the bottom of the page. Note that the title of the new page shown at the top.
- Make reference to the new page in whatever "directory" or site tree menu you have chosen by editing that portion of your site; as long as you type in the reference just as you created it, it will provide a direct link to the new page.
Auto-numbering of blog entries
From the Site Manager, click on "Autonumbering of pages". Then click "+ add autonumbering". You should see this:
Type in your blogging category (in our example, it is simply "blog") and press the "add autonumbering" button.
Step 2: Create the live template
Now that we have decided upon what our blogging category is, we must create a live template for it. This will arrange every blog entry to have the same layout — brilliant for consistency.
Note: Attempting to create the live template with the NewPage module's text entry box will not work! You must instead enter the page name directly into your browser's address bar. We recommend you read the glossary for more information.
So let's get started — create the page _template in your blogging category (i.e. blog:_template). On the page, we need to have the blogging entry content placed somewhere. Type in %%content%%, and save the page.
There are a few things you may like to include on your template:
- Automatic page parenting (emulated);
- Date and/or time of post;
- Page rating module (must have rating enabled);
- Comments module (must have forum enabled).
We'll go through how to do each of these one by one.
Automatic page parenting (emulated)
You may find that you like the breadcrumbs navigation when you assign a parent-page to a page. But it would get quite tedious if for every blog entry had to manually assign the parent page to our blogging category. A great workaround to this is by emulating the breadcrumbs navigation:
[[[Blog]]] » %%title%% %%content%%
Date and/or time of post
Featured in most blogs is the date and time of the entry. To do this, you simply add the following code:
[[[Blog]]] » %%title%% Posted on %%date|%A: %d %B, %Y|agohover%% %%content%%
That will show the day of the week, followed by the date (day month year). You can, however, change this to any format you like. See this page for more information.
Page rating module
You may like to give your readers the opportunity to rate your blogging entries. To do this, simply type:
[[[Blog]]] » %%title%% Posted on %%date|%A: %d %B, %Y|agohover%% %%content%% Like this entry? [[module Rate]]
Remember to enable rating for your blogging category.
Also common in most blogs is the ability for readers to 'comment back' or discuss what you have talked about. We can do this with the comments module. Even if you are not using a forum on your site, to use the comments module you will need to activate the forum from site manager -> forum and discussion -> settings.
[[[Blog]]] » %%title%% Posted on %%date|%A: %d %B, %Y|agohover%% %%content%% Like this entry? [[module Rate]] [[module Comments title="Leave a comment"]]
Step 3: Create blog home page
Now that you've set up the blogging category, you need a place to display the latest blog! Go to your blogging category page (ours is the blog page) and type in the following code:
[[size x-large]]Latest Blog:[[/size]] [[module ListPages order="dateCreatedDesc" limit="1" category="blog"]] [[size large]]%%title_linked%%[[/size]] posted on %%date|%A: %d %B, %Y|agohover%% %%short%% ([[[%%page_unix_name%% |read more…]]]) **Comments: %%comments%%**, Rating: %%rating%% [[/module]]
We are only showing the latest page (order="dateCreatedDesc" limit="1") of the "blog" category. What we are showing here is the title of the blog entry and when it was posted. Then we display only a short snippet of the page, and give a link for the user to "read more". After that we display the number of comments of that blog entry, and how highly it has been rated.
There are a few things you may like to include on your blog home page:
Step 4: RSS Feed (optional)
If you want your readers to have easy access to your blogs via an RSS feed, then you need to supply an RSS link on the blog home page. Just replace the ListPages module code with the following code:
[[module ListPages order="dateCreatedDesc" limit="1" category="blog" rss="Your blog title!"]]
Obviously, you would replace "Your blog title" with the title of your choice; ideally, your blog's name.
Step 5: Finish
Finally, you may want to add a "Create new blog entry" button somewhere on your site:
[[module NewPage category="blog" button="New Blog Entry" tags="blog"]]
It is not necessary to automatically tag each entry with 'blog' (tags="blog"), but you may want to anyway.
And you're done! Now you should create a blog entry in recognition of your achievement!
Summary of pages needed
There are some pages needed for a blog. After doing like this howto you will have following pages(assuming the method with "autonumbered" pages):
|blog||Blog Overview||"master" page - shows in an overview all existing "blog: … " pages (Step 3; Step 5)|
|blog:_template||Blog Live Template||"Layout holder", describes the output of all pages starting with "blog:" (Step 2)|
|blog:1||First Entry in my blog||This is my first entry in my blog! if you want you can comment this page with… . .|
|blog:2||Second news||I got my first comment! …|
1. The first 2 pages have to be keyed in manually - either on the adressbar or on the side bar if there exists a box for new pages.
2. The first page "blog" can be named free - this is NOT in category "blog:" !!
3. If the autonumbering feature is not used, then the Page-Names of "blog:x#y#z… " have to be set manually- in any order…
Here are a few good examples of blogging on Wikidot.