elxisPathway

Last update by Elxis Team

Handles site pathway

Class elxisPathway generates the pathway to the exact page the user is located at. The pathway can be generated both automatically and manually. If the current page (component) has not set a pathway manually then Elxis will auto-generate it based on the URI segments (see elxisURI).

Position pathway

The place where the pathway will be displayed on the page is set on the template's index.php file like this:

<?php $eDoc->pathway(); ?>

If you want to display the indicator "You are here" before the pathway then use in your template instead:

<?php $eDoc->pathway(true); ?>

Create custom pathways

There are a number of methods you can use to set your pathway to anything you like. Start by accessing the pathway instance.

$path = eFactory::getPathway();

Methods

$path->setHome($title, $link, $ssl);
Sets the root node of the pathway.
  • (string) $title The title of the link and the text to be displayed.
  • (string) $link An elxis formatted URI string
  • (boolean) $ssl Whether the page must be access via SSL or not (if SSL in enabled in web site).
$path->addNode($title, $link, $ssl);
Adds a new node in the pathway.

$path->setSeparator($separator);
Sets the separator to be used between the pathway nodes (by default &raquo;)

$path->deleteAllNodes($including_home);
Deletes all existing nodes.
  • (boolean) $including_home If true then the root node will also be deleted.
$path->deleteLastNode();
Deletes the last inserted pathway node (not the home node).

$path->getNodes();
Returns an array of all existing nodes.

$path->getHTMLNodes($auto_make_if_empty);
Generates the pathway HTML and returns the output as a string.
  • (boolean) $auto_make_if_empty If true then elxisPathway will auto-generate the pathway nodes if there are no nodes.

Example

$pathway = eFactory::getPathway();
$eLang = eFactory::getLang();

$pathway->deleteAllNodes();
$pathway->addNode($eLang->get('GALLERY'), 'content:gallery/');
$pathway->addNode('Landscapes');

It has been read 5453 times
elxisFiles
Previous article
elxisFiles

You are free to copy, distribute and transmit the articles in this site for non-commercial purposes.
Creative Commons 3.0