Mara cms blog interface

Order of listing

sample image for table of contentsA blog typically lists articles by date of first publication, newest first. Since articles in a Mara cms blog are files, initially it was intended to use the file creation date as the criterion for listing articles. However, problems were encountered with this approach in that the transfer of a site to another host will typically not preserve this information. It was thus decided to use the file modification time instead, as this is more reliably supported. This does have the slight disadvantage that editing an article (even correcting a typo) will always return it to the head of the list.

As an alternative, a meta tag can be inserted containing an ordinal. Typically this ordinal  will be a unix timestamp. Though, you could instead simply number your articles 1,2,3 this way, the highest number being the current one. The format of this tag is:

 <META NAME="creation_time" CONTENT="[any numeric data]">

The eventual intention is to make the creation of this meta tag automatic when a blog page is edited in the online editor. In which case it will assume the timestamp of the file itself, as of that moment. If the meta tag already exists, including where you have manually numbered the files, then its value will be preserved. Thus, the article's date of creation will effectively be protected against loss should the file be transferred elsewhere by a mechanism which does not preserve the file info. For the moment this tag is optional and manual, but is respected by the system and where present, takes precedence over the file's timestamp.

When using the builtin HTML blog contents listing, dates will be represented in human-readable format after each article. Manually created indexes will not be shown.

For advanced users, if building the TOC using the array method you have the option of using the timestamp directly, or of using the ['datestring'] array property, which displays the date in international format instead of as a number. If the numeral is less than 1000000000 then this probably means you indexed the file manually in which case datestring is set to null, so you don't have to take any specific action to prevent these indexes being displayed. Examine theme.php in the blog2 theme to see how this works.

 


Recently Visited
Powered by Mara cms