Sitelinks Plugin

The Sitelinks Plugin file contains a function that assists in writing links like footer navigation links or breadcrumbs navigation links.

Loading this Plugin

This plugin is loaded using the following code:

loadPlugin "sitelinks"

The function:

siteLinks(pLinks, pCurrentPage, pSeparator, pSelector)

The first parameter is a numbered array of site links preferable stored in a custom config file in your application/config/ folder. The second parameter indicates the current page. The third parameter defines the link separator. The fourth parameter is used to define the div and paragraph id/class selector.

# THE LINKS ARRAY
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"]


put footerLinks(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 2009 yourname.com</a><span class="separator"> :: </span>
<a href="http://yourSite.com/home">Home ::
<a href="http://yourSite.com/imprint">Imprint</a><span class="separator"> :: </span>
<span class="currentpage">Contact</span>
</p>
</div>