UserGuide: Menu plugin

Menu plugin provides simple yet flexible way to create one level menus.

Simple usage(Edit)

{menu
  parent=[Main|Main page]
  [Admin plugin|UserGuide: Admin plugin]
  [Forum|./forum/]
  [Main page]
} 

Result is visible on the right. Parent tag is available since LionWiki 3.1.

Styles, format ...(Edit)

Format of the menu is defined in a file plugins/Menu/default.html, let's take a look on it:

<div class="tagCloud" style="width:auto;padding-bottom:0px;">
<b style="font-variant:small-caps;">Navigation</b><br />
<ul style="padding-left:20px;">
	{item}
	<li class="{class}" title="Go to {name}">
		<a href="{link}">{name}</a>
	</li>
	{/item}
</ul>
</div>

It is basically pure HTML + CSS (+ whatever) + some special tags. The most important is {item} and {/item}. This defines part of the template which contains items of the menu, i.e. part which will be repeated.

Inside this part, you can see other tags. {name} and {link} are self explanatory.

{class} is more interesting. For exact styling, you often need to style first and last element of a menu in a special way. Menu plugin automatically replaces {class} tag with classes "first" and "last" when appropriate (in case of one item, it has assigned both "first" and "last" classes).

More menu templates(Edit)

It's quite possible that you'll need more than one type of menu. In this case, you can create other template file in plugins/Menu directory and use special syntax:

{menu(special.html) [A] [B] [C] [D]}

You'll usually need to use the same navigation menu in a several pages. The only recommended way to insert menu is through subpage mechanism, i.e. create page called e.g. "menu" with menu syntax and then put following to all pages where you want this menu:

{include:menu}

Details(Edit)

There can be any number of any delimiters between items, except for [ and ].

Links are recognized in the same way as in core LionWiki, except for that it won't recognize missing pages.