0

My joomla version is 3.7.5. The home link in breadcrumbs is "domain/index.php". I want to remove the index.php part. How i can modify the code from breadcrumbs helper file to achive this?

$item->link = JRoute::_('index.php?Itemid=' . $home->id);
        array_unshift($crumbs, $item);

If i replace index.php with / the result is "domain/101 (menu id)".

4
  • Have a look at this question. The answers will most likely help you: joomla.stackexchange.com/q/696/168
    – Lodder
    Commented Sep 26, 2017 at 12:28
  • thank you for your answer, but i don't want to remove index.php global. I want to remove it, only in breadcrumbs link for home page.
    – johnl
    Commented Sep 26, 2017 at 19:26
  • Ah I see. Perhaps just replace it using str_replace then? php.net/manual/en/function.str-replace.php
    – Lodder
    Commented Sep 26, 2017 at 19:28
  • Do as @Lodder recommend - the use of .htaccess has so many advantages - both SEF, SEO and security
    – KlintWeb
    Commented Sep 27, 2017 at 9:33

1 Answer 1

0

I replaced 'index.php?Itemid=' . $home->id with my domain and problem fixed. Unfortunately, (correct comment from FFrewin below) like all core hacks, with every joomla update, i must change the file again (can't use template override for helper.php files). Then i found mvc override plugin from joomla documentation and i made template override for mod_breadcrumbs/helper.php file. It works fine.

2
  • Note that if you have modified a core file, you will have to maintain this change when you update Joomla!, as most likely it will be overwritten by the updates.
    – FFrewin
    Commented Sep 27, 2017 at 20:41
  • @FFrewin correct. I edited my answer. Thank you.
    – johnl
    Commented Sep 28, 2017 at 17:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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