1

Using Joomla 3.9.12 and SP Portfolio v1.7

I have a menu item called Locations, this is a menu item type SP Simple Portfolio » Items

Whenever I visit example.com/locations I can see all my portfolio items, great. If I select one of the portfolio items, e.g. Paris, I am taken to example.com/locations/paris, works as expected.

I have enabled the Joomla breadcrumbs module on this page and it displays;

You are here: Home / Locations / Paris

  • Selecting Home successfully takes me to the home page example.com
  • Selecting Locations takes me to example.com/locations/items - this page doesn't exist so I get a 404 error.

When I select Locations in the breadcrumbs I want to go to example.com/locations.

No idea where the additional /items URL parameter is coming from, I can't see it configured anywhere in my menu setup.

What do I need to do in order to get this working how I want?

  • This seems like an intelligent workaround: yellowwebmonkey.com/developer-blog/item/… . This looks kinda close: joomla.stackexchange.com/q/22827/12352 – mickmackusa Nov 18 at 21:44
  • Do you have any SEF extensions installed? I get completely different results on a clean installation. Clicking on an item takes me to example.com/locations/item/1-paris and breadcrumb only contains Home > Locations. And Locations is not clickable. – Sharky Nov 19 at 7:04
  • @Sharky I don't have any third party SEF extensions installed. Joomshaper have created an override of mod_breadcrumbs I might try to edit this, although I don't think I should have to :/ – jonboy Nov 19 at 9:27
  • Thanks @mickmackusa those are both good suggestions. I'm kind of reluctant to create any url rewrites as it can get messy. I've already tired creating a hidden menu item called items with menu item alias to locations but it doesn't work. I can't understand why the breadcrumbs is displaying /items at all? – jonboy Nov 19 at 9:34
0

I managed to get this working by editing the (already existing Helix / Joomshaper) override.

After spending a (very!) long time trying to figure out where the /items url parameter was coming from, I gave up and modified the override.

I know this isn't a solution but it solves my problem, and possibly someone else that uses the Helix framework or a Joomshaper template.

Add this code to your-template\html\mod_breadcrumbs\default.php, before the foreach block.

array_walk($list, function (&$v) { 
    if ($v->name == 'Items') $v->link = dirname($v->link); 
});

The breadcrumbs code returns an array with name and link keys. This checks the link and if it contains Items, it will be removed.

Working do far..

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.