The last item in the pathway is never a link. We only need to specify a URI
when we add items that are not going to be the last item in the pathway. This
example demonstrates how we might build the pathway for an item within the
aforementioned category:
$pathway->addItem($categoryName, $categoryURI);
$pathway->addItem($itemName);
Notice this time we include a URI when adding the category item. It is normal to
add to the pathway in the display() method of each JView class. It is important to
realize that we must always add pathway items in order of appearance.
There is one pitfall to the currently explained way of adding items to the pathway. It
is likely that in the described scenario, we would be able to create a menu item that
links directly to a category or item in the component.
We can overcome this by interrogating the current menu item. This example shows
how we get access to the current menu item:
$menus =& JMenu::getInstance();
$menuitem =& $menus->getActive();
The JMenu class is responsible for the handling of Joomla! menus.
Pages:
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357