How to Create Breadcrumbs in Joomla 1.5, 1.6 & 2.5

Breadcrumbs are essential part of any website for a good user experience. Breadcrumbs allows the users to know where did they cam from. Breadcrumbs shows a hierarchical structure with links so visitor can move anywhere easily. Like other web platforms, Joomla also supports breadcrumbs.

In Joomla, we use two parameters for the creation process of breadcrumbs, first one is the title (text) and second is the URL.

Example for Joomla 1.5 and 1.6

[code type=”php”]

class myexampleView extends JView {
function display($tpl = null) {

$mainfr = &JFactory::getApplication();
$docu = &JFactory::getDocument();
$pathw =& $mainframe->getPathway();

JHTML::_(‘behavior.modal’);
$model =& $this->getModel();
$data = $model->getData();

$this->assignRef( ‘events’, $data);

$document->setTitle( $this->events[‘name’] );
$pathway->addItem($this->events[‘name’], ”);

parent::display($tpl);

}
}

[/code]

Example for Joomla 2.5

[code type=”php”]

public function display($tpl = null)
{

$app = JFactory::getApplication();
$pathway = $app->getPathway();
$pathway->addItem(‘Breadcrumb’, ‘http://www.yourdomain.tld’);

parent::display($tpl);

}

[/code]

Duan Lingxin

Duan Lingxin

Content crafter and chief editor at Scratching Info. Also regular contributor on other major online tech platforms. Security Specialist by day and a writer by night, he does his best to instill his knowledge about tech while delivering inspiring and life changing resources through his writing,

More Posts - Website

Leave a Comment