How to manually override the pathway

Have a programming question regarding your component, plug-in, extension or core hacks? Have an interesting tidbit, FAQ or programming tip you’d like to share? This is the place for you.

Moderators: tjay, seadap, Rogue4ngel, matthewhayashida

Post Reply
User avatar
madsamurai
Joomla! Apprentice
Joomla! Apprentice
Posts: 20
Joined: Tue Oct 02, 2007 6:13 pm

How to manually override the pathway

Post by madsamurai » Thu Mar 06, 2008 4:33 am

I'm writing a fairly complex custom component, and I'm having trouble managing my breadcrumbs. Joomla (1.5.1) seems to want to add things I don't want, and doesn't seem to consistently include the base component link. Seems much more dependent on the menus than it does on the component structure.

Anyway, what's happening is in my component views I use the following:

Code: Select all

global $mainframe;
$breadcrumbs =& $mainframe->getPathWay();
$breadcrumbs->addItem('Customer Center', sefRelToAbs( 'index.php?option=com_clientcenter'));
$breadcrumbs->addItem('Customer Info', '');
which works fine for adding the links I want. Unfortunately it also includes the menu link, and sometimes doubles up the component (which would be the Customer Center part), and other times doesn't, like Home >> My Info >> Customer Center >> Customer Info. My Info comes from the menu link, but I don't want all of my component menu items to have to be submenus of the customer center menu item either.

What I would really like to do is manually control the breadcrumbs for all of the views in my component, without Joomla adding anything except the Home link... just give me a blank slate and let me add my own pathway how I want it. The wiki docs say you can set the parameters of getPathway(true, false) and that should eliminate the comonent part of the return, but it doesn't actually change anything... even setting getPathway (false, false) gives me back exactly the same thing tho it shouldn't return the home link or the component, according to the docs. There also doesn't seem to be any way to remove an item from the pathway array, only add them.

Can anyone offer any solution? I'm totally happy to manually create my pathway from scratch, home link and all, if that's possible... it's a little thing, but it's frustrating the hell outa me. Thanks in advance!

Post Reply