SiteLinks Helper
The SiteLinks Helper file contains a function that assists in writing links like footer navigation links or breadcrumbs navigation links.
Loading this Helper
This helper is loaded using the following code:
rigLoadHelper "sitelinks"
The function:
rigSiteLinks(pLinks, pCurrentPage, pSeparator, pSelector)
Parameters
- pLinks: is a numbered array of site links preferable stored in a custom config file in your application/config/ folder
- pCurrentPage: indicates the current page
- pSeparator: defines the link separator
- pSelector: is used to define the div and paragraph id/class selector
Example:
# THE LINKS ARRAY IN YOUR CUSTOM CONFIG FILE
put "copyright" into tFooterlinks[1]["copyright 2009 yourname.com"]
put "home" into tFooterlinks[2]["Home"]
put "contact" into tFooterlinks[3]["Contact"]
put "imprint" into tFooterlinks[4]["Imprint"]
# THE STATEMENT IN YOUR CONTROLLER
put rigSiteLinks(tFooterlinks, "Contact", " :: ", "footer") into gData["footerLinks"]
Note: The elements (values) of the links array are URI segments and the keys are the names displayed.
The output looks like this:
<div id="footer">
<p class="footer">
<a href="http://yourSite.com/copyright">copyright 2011 yourname.com</a><span class="separator"> :: </span>
<a href="http://yourSite.com/home">Home<span class="separator"> :: </span>
<span class="currentpage">Contact</span><span class="separator"> :: </span>
<a href="http://yourSite.com/imprint">Imprint</a>
</p>
</div>
Alternatively you can add css id selectors to the links in order to make them distinguishable in your style sheet. This way you can use images instead of text for your navigation links. To accomplish this you need to append a comma and an id selector to each URI and you need to use different numbers of nonbreaking spaces as names so that you are able to define the current page link.
Here is an example:
# THE LINKS ARRAY IN YOUR CUSTOM CONFIG FILE
put "copyright,IDselectorCopyright" into tFooterlinks[1][" "]
put "home,IDselectorHome" into tFooterlinks[2][" "]
put "contact,IDselectorContact" into tFooterlinks[3][" "]
put "imprint,IDselectorImprint" into tFooterlinks[4][" "]
# THE STATEMENT IN YOUR CONTROLLER
put rigSiteLinks(tFooterlinks, " ", " :: ", "footer") into gData["footerLinks"]
The output looks like this:
<div id="footer">
<p class="footer">
<a href="http://yourSite.com/copyright" id="IDselectorCopyright">copyright 2011 yourname.com</a><span class="separator"> :: </span>
<a href="http://yourSite.com/home" id="IDselectorHome">Home<span class="separator"> :: </span>
<span class="currentpage" id="IDselectorContact">Contact</span><span class="separator"> :: </span>
<a href="http://yourSite.com/imprint" id="IDselectorImprint">Imprint</a>
</p>
</div>