Editing the navigation specification
Web Site Navigation generates navigation bars from the site structure and the appearance definition file, the Specification page. The Specification page is an HTML file that has special comment tags and expressions.
- Create a Web project.
- Create a Web site.
- Create a page template.
- Apply the page template to the Web site.
- Add navigation to the page template.
You can modify the navigation by editing the Specification page. The following is a list of Web Site Navigation and associated specification pages that are included with this product:
Web Site Navigation Specification page (HTML or JSP) Horizontal Bar horizontal-text horizontal
horizontal-button
horizontal-sep
horizontal-tab
Horizontal Tabs horizontal-tab01 horizontal-tab02
horizontal-tab03
Vertical Bar vertical-text vertical
vertical-button
vertical-sep
vertical-tab
Vertical Tabs vertical-tab01 Navigation Trail trail trail_horizontal
trail_vertical
Drop-Down Menu dropdown Site Map sitemap sitemap_vertical
To modify the navigation specification:
- To open Web Site Navigation, expand your Web project in the Project Explorer view and double-click
Web Site Navigation.
- Right-click the navigation element and select
Properties to open the Properties view. You can edit the navigation specification by editing the information in the different properties tabs.
- If you want to edit the navigation specification by editing the specification code directly click the Specification tab in the Properties view.
- Click Open to open the specification page for the navigation element.
- Edit the specification page then press CTRL+S to save the file.
A specification page can be specified as an attribute of siteedit:navbar, siteedit:navtrail, siteedit:navtab and siteedit:sitemap tags, which are the tags inserted in your Web pages when you add Web Site Navigation such as navigation bars, navigation trails, navigation tabs, and site maps.
The following is an example of a Specification page:
<HTML> <HEAD> <TITLE>horizontal</TITLE> </HEAD> <BODY> <TABLE border="0"> <TBODY> <TR> <!-- siteedit:forEach var="item" items="${sitenav.items}" begin="0" step="1" varStatus="status" --> <TD><A href="${item.href}"${item.label}</A></TD> <!-- /siteedit:forEach --> </TR> </TBODY> </TABLE> </BODY> </HTML>You can edit the siteedit:forEach tag by editing the expressions within that tag:
Expression Description ${item.label} Represents the navigation label represented by the current item. ${item.href} Represents a context root relative URL represented by the current item. ${item.ancestor} Is true if the current item is an ancestor of the current page.
${item.self} Is true if the current item is the current page.
${item.level} The number of levels from the navigation root. ${item.first} Is true for the first loop in the forEach loop.
${item.last} Is true for the last loop in the forEach loop.
${item.group} Is true if the current item is a group.
You can edit the expressions for conditional and logical operators:
Where n is a number and <<varName>> is the variable inside of the expressions in the table above.
Expression Description ${<<varName>> le n}Is true if item.levelis equal to or less than n.
${<<varName>> lt n}Is true if item.level is less than n.
${<<varName>> ge n}Is true if item.level is equal to or greater than n.
${<<varName>> gt n}Is true if item.level is greater than n.
${<<varName1>> and <<varName2>>} ${<<varName1>> ir <<varName2>>} ${not <<varName2>>}You can edit the siteedit:forEach tag by editing the tags within that tag:
Tag Usage Description <!--siteedit:if test="<<condition>>"--> <<content>> <!--/siteedit:if-->If <<condition>> is true, then output will be <<content>>. <!-- siteedit choose --> <!-- siteedit:when test="<<conditionA>>"--> <<contentA>> <!--/siteedit.when--> <!--siteedit.when test="<<conditionB>>"--> <<contentB>> <!--/siteedit.when--> <!--siteedit:otherwise--> <<contentO>> <!--/siteedit:otherwise--> <!--/siteedit:choose-->
- If <<conditionA>> is true, then output will be <<contentA>>.
- If <<conditionA>> is false AND <<conditionB>> is true, then output will be <<contentB>>.
- If <<conditionA>> AND <<conditionB>> are false, then output will be <<contentO>>.
This is similar to the following expression in the C programming language:
if (conditionA) {contentA} else if (conditionB) {contentB} else {contentO} <!--siteedit:forEach var="<<varName>>" begin="<<beginNum>>" end="<<endNum>>"--> <<content>> <!--/siteedit:forEach-->Repeats <<content>> "<<endNum>> - <<beginNum>> + 1" times. <!-- siteedit:set var="<<varName>>" value="<<expression>>" --> <!-- /siteedit:set -->Set the result of <<expression>> to <<varName>>. The result can be referred to as ${varName} in the following part.