The <navlinks> Tag
A common site structure strategy is to provide Back, Forward and Up
links between pages. This is especially frequent in papers or documentation.
WebMake now supports this using the <navlinks> tag.
To use this, first define a sitemap. This tells WebMake how to order the page
hierarchy, and which pages to include.
Next, define 3 content items, one for previous, one for next and one
for up links. These should contain references to ${url}
(note: not $(url)), which will be replaced with the URL for
the next, previous, or parent content item, whichever is applicable for the
direction in question.
Also, references to ${name} will be expanded to the name of the
content item in that direction, allowing you to retrieve metadata for that
content like so: $[${name}.title] .
You can also add content items to be used when there is no previous,
next or up content item; for example, the "top" page of a site has
no up content item. These are strictly optional though.
Then add a <navlinks> tag to the WebMake file as follows.
<navlinks name=mynavlinks map=sitemapname
up=upcontentname
next=nextcontentname
prev=prevcontentname
noup=noupcontentname
nonext=nonextcontentname
noprev=noprevcontentname>
content text
</navlinks>
The content text acts just like a normal content item, but references to
${nexttext}, ${prevtext} or ${uptext}
will be replaced with the appropriate content item; e.g. ${uptext}
will be replaced by either ${upcontentname} or
${noupcontentname} depending on if this is the top page or
not.
You can then add references to $ in other content
items, and the navigation links will be inserted. Note! be sure to use
a deferred reference, or the links may not appear!
Attribute Reference
These are the attributes accepted by the <navlinks> tag.
-
name
-
the name of the navigation-links content item.
Required.
-
map
-
the name of the sitemap used to determine page
ordering. Required.
-
up
-
the name of the content item used to draw Up
links. Required.
-
next
-
the name of the content item used to draw Next
links. Required.
-
prev
-
the name of the content item used to draw Prev
links. Required.
-
noup
-
the name of the content item used when there is
no Up link, ie. for the page at the top level of the
site. Optional -- the default is an empty string.
-
nonext
-
the name of the content item used when there is
no Next link, ie. the last page in the site.
Optional -- the default is an empty string.
-
noprev
-
the name of the content item used when there is
no Prev link, ie. for the first page in the site.
Optional -- the default is an empty string.
Example
This will generate an extremely simple set of <a href> links, no frills.
The sitemap it uses isn't specified here; see the sitemap documentation for details on doing that.
<content name=up><a href=${url}>Up</a></content>
<content name=next><a href=${url}>Next</a></content>
<content name=prev><a href=${url}>Prev</a></content>
<navlinks name=name map=sitemapname up=up next=next prev=prev>
${prevtext} | ${uptext} | ${nexttext}
</navlinks>
|