Blog Menu

Outputs a menu of blog categories, tags, years, months, recent posts or a search form.

In Unicity 3.02 and lower outputs div and p tags. In Unicity 3.03 outputs ul > li type menus by default in new installs (switchable via config variable).

PHP usage:

include_once('modules/blogmenu/index.php');
	
string blogmenu ( string $display1, [string $display2, [string $display3, [string $display4, [string $display5, [string $display6]]]]])

string blogmenu ( string $display1, [string $display2, [string $display3, [string $display4, [string $display5, [string $display6]]]]])

CMS usage:

%module-blogmenu-$display1-[$display2=""[-$display3=""[-$display4=""[-$display5=""[-$display6=""]]]]]%

Parameters

display1 - 6

Each of the display parameters takes one of the following values:

string "cats". Displays a menu of blog categories in alphabetical order. Only categories that have posts in them will be displayed.

The title above the menu will default to $lang['blog-menu-category'] (and can be edited in a custom language file), or can be overridden by the config variable $config['blog-menu-cats-title'].

The output of each menu item is set in $lang['blog-menu-category-output-li'] (new style) or $lang['blog-menu-category-output'] (old style).

string "tags". Displays a menu of blog tags. Tags that are displayed in the menu come from $config['blog-preset-tags'].

The title above the menu will default to $lang['blog-menu-tag'] (and can be edited in a custom language file), or can be overridden by the config variable $config['blog-menu-tags-title'].

The output of each menu item is set in $lang['blog-menu-tag-output-li'] (new style) or $lang['blog-menu-tag-output'] (old style).

string "years". Displays a menu of years in reverse order (most recent years first). Only years with posts will be shown. A default of 5 years will be shown, but can be overridden by $config['blog-menu-year-number'].

The title above the menu will default to $lang['blog-menu-year'] (and can be edited in a custom language file), or can be overridden by the config variable $config['blog-menu-year-title'].

The output of each menu item is set in $lang['blog-menu-year-output-li'] (new style) or $lang['blog-menu-year-output'] (old style).

string "months". Displays a menu of months in reverse order (most recent months first). Only months with posts will be shown. A default of 10 months will be shown, but can be overridden by $config['blog-menu-months-number'].

The title above the menu will default to $lang['blog-menu-month'] (and can be edited in a custom language file), or can be overridden by the config variable $config['blog-menu-months-title'].

The output of each menu item is set in $lang['blog-menu-month-output-li'] (new style) or $lang['blog-menu-month-output'] (old style).

string "recentdays". Displays a menu of recent post titles in reverse date order (most recent days first). Posts from a default of 30 days will be shown, but can be overridden by $config['blog-menu-recent-post-days'].

The title above the menu will default to $lang['blog-menu-recent-posts'] (and can be edited in a custom language file), or can be overridden by the config variable $config['blog-menu-recentdays-title'].

The output of each menu item is set in $lang['blog-menu-post-output-li'] (new style) or $lang['blog-menu-post-output'] (old style).

string "searchform". Displays a search form, specifically to search blog posts, using the blog menu.

The title above the menu will default to $lang['blog-menu-search'] (and can be edited in a custom language file), or can be overridden by the config variable $config['blog-menu-search-title'].

The output of the search form is set in $lang['blog-menu-search-form']

Config Options

Optional. boolean $config['blog-menu-modern-html']

Set to TRUE in Unicity 3.03 installations. When TRUE switches output to ul > li style menus.

Optional. string $config['blog-preset-tags']

If you wish to make use of tags in a menu, set a comma separated list of tags here. For example: "Tag 1,Tag 2,Tag 3".

Optional. string $config['blog-page-menu-url']

Sets the URL to which the blog menu links. Required if the blog menu is being used on a page that doesn't contain the blog module itself. For example: "latest-news/blog". If not set, defaults to current page.

Optional. boolean $config['blog-hide-back-link']

If set to TRUE, hides the "back to main blog page" link that is output under the blog menu on pages other than the front page of the blog. The text of this link can be changed in $lang['blog-menu-back-link-li'] (new style) or $lang['blog-menu-back-link'] (old style).

Required. string $lang['blog-menu-heading-tag']

Set in the language file, defaults to "h3" but can be set to any tag you wish to open and close menu headings with.

Examples

Menu showing categories only:

%module-blogmenu-cats%

Menu showing categories, years, months, tags, recent posts and a search form:

%module-blogmenu-cats-years-months-tags-recentdays-searchform%