Page 1 of 1

Hide Breadcrumb on index.php

Posted: Tue Oct 12, 2021 9:56 am
by heatherbell
Hide Breadcrumb on index.php only.
What's the best/easiest way to do this?
I modified core file cm_header_breadcrumb.php by adding

Code: Select all

if(basename($PHP_SELF) == 'index.php' && $cPath == '' && !isset($_GET['manufacturers_id'])) {
        echo '';
      }else{
This worked so I copied that file to /templates/override/modules/content/header/ which I expected to work but does not - have I done something wrong here?
Must I create a new module to do this or could/should this be done with a hook? If so, how?
Any pointers appreciated.

Re: Hide Breadcrumb on index.php

Posted: Tue Oct 12, 2021 10:55 am
by ecartz
heatherbell wrote: Tue Oct 12, 2021 9:56 am I expected to work but does not
"[D]oes not" could mean a variety of things.

1. It still displays on the index page.
2. It does not display on the index_nested and index_products page.
3. It does not display on any pages.
4. The site breaks and shows a white screen or error message.

In the file https://github.com/CE-PhoenixCart/Phoen ... dcrumb.php

If you copy to /templates/override/modules/content/header/ and add at the beginning

Code: Select all

<?php
if (basename(Request::get_page()) === 'index.php' && empty($GLOBALS['cPath']) && empty($_GET['manufacturers_id'])) {
  return;
}
?>
does that do what you want? Not display on the welcome page but do display on the category and product listings?

If not, are you on a site where the template is set (in admin) to override and not default?

Re: Hide Breadcrumb on index.php

Posted: Tue Oct 12, 2021 11:16 am
by heatherbell
ecartz wrote: Tue Oct 12, 2021 10:55 amdoes that do what you want?
That does exactly what I want. Many thanks for taking the time.