This is an example of a pathway for a
menu item named 'Joomla! Overview':
Joomla! handles the pathway to the depth of the menu item. Beyond that we must
manually add items to the breadcrumb. For example, a component that handles
categories and multiple items will generally add to the pathway in order to display
its internal hierarchy.
The pathway is handled by a global JPathway object. We can access the object using
the application. This example demonstrates how we get the breadcrumb handler:
$pathway =& $mainframe->getPathway();
Notice that, as per usual, we must use the =& assignment operator. If we do not, any
changes we make to $pathway will not be reflected.
Customizing the Page
[ 260 ]
We use the addItem() method to add new items to the pathway. Imagine we are
viewing a category in a component and we want to add the category as an extra layer
in the pathway trail:
$pathway->addItem($categoryName);
There is one glaringly obvious thing missing from this example. There is no URI.
Since we are viewing the category, there is no need to specify the URI because it is
the current URI.
Pages:
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356