Results 1 to 10 of 13

Hybrid View

  1. #1
    Join Date
    May 2006
    Location
    Pacific Northwest (Canada Jr.)
    Posts
    25
    Plugin Contributions
    0

    Removing the "Home" link from breadcrumbs

    Hi again! I've previously posted as "Audra" but I lost access to my account with the board switch.

    Anyway- I'm happily working my way through installing and customizing the new version of Zen Cart. Everything is going great! I'm excited to have such possibilities at hand.

    I've been able to find a few of the issues I've had in new posts but haven't found an answer to this one yet! I found a few close ones in the archived messages, but not exactly what I'm looking for.

    I'd like to remove just the "Home" and its following separator from the breadcrumbs. I attempted this by leaving the "Home" in english.php blank, but then I lose the "Home" link in the navigation bar. I want to keep the Nav Bar one.

    Then I tried commenting out the home link in the breadcrumbs.php file

    Code:
    if ($this->_trail[$i]['title'] == HEADER_TITLE_CATALOG) {
    		$trail_string .= '  <a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . $this->_trail[$i]['title'] . '</a>';
            } else {
    		$trail_string .= '  <a href="' . $this->_trail[$i]['link'] . '">' . $this->_trail[$i]['title'] . '</a>';
            }
          } else {
            $trail_string .= $this->_trail[$i]['title'];
          }
    
          if (($i+1) < $n) $trail_string .= $separator;
          $trail_string .= "\n";
        }
    and I get this error:
    Parse error: syntax error, unexpected T_ELSE in /home/.../includes/classes/breadcrumb.php on line 59

    I'd just like to lose the home link in breadcrumbs. I don't want to disable breadcrumbs altogether. Any ideas where to do this? Please don't tell me it's in admin and I'm just missing it!

  2. #2
    Join Date
    May 2006
    Location
    Pacific Northwest (Canada Jr.)
    Posts
    25
    Plugin Contributions
    0

    Default Re: Removing the "Home" link from breadcrumbs

    Just checking in to see if there's an answer for this yet?

  3. #3
    Join Date
    May 2006
    Posts
    14
    Plugin Contributions
    0

    Idea or Suggestion Re: Removing the "Home" link from breadcrumbs

    This was easy enough for me to figure out, as I had just been looking at the file in question for a different purpose.

    All you have to do is add the following code:


    if ($this->_trail[$i]['title'] == 'Home')
    {
    continue;
    }
    prior to:

    if (isset($this->_trail[$i]['link']) && zen_not_null($this->_trail[$i]['link']) && !$skip_link ) {

  4. #4

    Default Re: Removing the "Home" link from breadcrumbs

    Yep, works like a charm!

  5. #5
    Join Date
    Nov 2005
    Location
    Colorado Springs, CO USA
    Posts
    7,033
    Plugin Contributions
    31

    Default Re: Removing the "Home" link from breadcrumbs

    or you could do it in includes -> templates -> YOURTEMPLATE -> common -> tpl_main_page.php and not play around with the Core Code

    just add
    Code:
    <!-- bof  breadcrumb -->
    <?php if (DEFINE_BREADCRUMB_STATUS == '1' && ($current_page!='index' || (int)$cPath>0 )) { ?>    <div id="navBreadCrumb"><?php echo $breadcrumb->trail(BREAD_CRUMBS_SEPARATOR); ?></div>
    <?php } ?>
    <!-- eof breadcrumb -->

  6. #6
    Join Date
    May 2006
    Posts
    14
    Plugin Contributions
    0

    Re: Removing the "Home" link from breadcrumbs

    Quote Originally Posted by clydejones
    or you could do it in includes -> templates -> YOURTEMPLATE -> common -> tpl_main_page.php and not play around with the Core Code

    just add
    Code:
    <!-- bof  breadcrumb -->
    <?php if (DEFINE_BREADCRUMB_STATUS == '1' && ($current_page!='index' || (int)$cPath>0 )) { ?>    <div id="navBreadCrumb"><?php echo $breadcrumb->trail(BREAD_CRUMBS_SEPARATOR); ?></div>
    <?php } ?>
    <!-- eof breadcrumb -->
    While I am all for not modifying core files.... This recommendation doesn't do what is being asked. Your code removes the breadcrumbs completely under certain conditions.

 

 

Similar Threads

  1. Removing "Home" link from top Navbar
    By fairstranger in forum General Questions
    Replies: 2
    Last Post: 7 Oct 2011, 11:07 AM
  2. Removing text "Home" from the home page
    By HeyIts007 in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 11 Apr 2011, 03:31 PM
  3. Point breadcrumbs "Home" link to different URL
    By DivaVocals in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 20 Oct 2008, 08:24 PM
  4. Change "home" link title in breadcrumbs
    By balsama in forum General Questions
    Replies: 1
    Last Post: 28 Nov 2007, 03:28 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg