Menu Tag
- In this article:
Introduction
Well-known, an integral part of the page is menu. It navigate users overall web-site, and describe what kind of content was presented on. Since ImCMS based on document-presented pages each menu item can be present as specific document link
Use in template
There are several important part configure menu fully:
HTML structure such as
ul-li
list ordiv-div
listInformation about menu-nesting
Default 2-level structured menu shows below:
<imcms:menu no='1' docId="1001">
<ul>
<imcms:menuloop>
<imcms:menuitem>
<li>
<imcms:menuitemlink>
${menuitem.document.headline}
</imcms:menuitemlink>
<!-- sub menu definition -->
<imcms:menuloop>
<imcms:menuitem>
<div>
<imcms:menuitemlink>
${menuitem.document.headline}
</imcms:menuitemlink>
</div>
</imcms:menuitem>
</imcms:menuloop>
</li>
</imcms:menuitem>
</imcms:menuloop>
</ul>
</imcms:menu>
Available list of tag attributes:
Example:
<%@taglib prefix="imcms" uri="imcms" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Template</title>
<meta charset="utf-8"/>
</head>
<body>
<imcms:menu no='1' docId="1001">
<ul>
<imcms:menuloop>
<imcms:menuitem>
<li>
<imcms:menuitemlink>
${menuitem.title}
</imcms:menuitemlink>
<!-- sub menu definition -->
<imcms:menuloop>
<imcms:menuitem>
<div>
<imcms:menuitemlink>
${menuitem.title}
</imcms:menuitemlink>
</div>
</imcms:menuitem>
</imcms:menuloop>
</li>
</imcms:menuitem>
</imcms:menuloop>
</ul>
</imcms:menu>
</body>
</html>
Second example: with use nested, disable nested in the menu and in each menuItem
<imcms:menu no='1' docId="1001" pre="<div><ul>" post="</ul></div>" nested="true" label="something" showlabel="true">
<li><imcms:menuitemlink>${menuitem.title}</imcms:menuitemlink></li>
</imcms:menu>
Third example: generate automatic html menu items
<imcms:menu index='1' nested="true" wrap="span, b, i" attributes="wcag, data, class", treeKey="20"/>