X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Breadcrumb Home Link (https://forum.x-cart.com/showthread.php?t=49862)

edawlem 09-24-2009 09:41 AM

Breadcrumb Home Link
 
I have the x-cart at http://www.thevegetarianexpress.com/cart

I don't want to use the x-cart home.php anywhere. I've redirected the logo in the head.tpl to the site root. I also need to change the breadcrumb link (see below). Am I missing anything else?

In the breadcrumbs I want users to click on the "Vegetarian Express" or home link and have it take them to http://www.thevegetarianexpress.com without messing up the rest of the breadcrumbs. I've seen reference to this, but not with the path arrangement that I have.

Vetrivel 09-24-2009 08:13 PM

Re: Breadcrumb Home Link
 
In the auth.php

you can able see the code like this.
PHP Code:

$location[] = array((!empty($lbl_site_name) ? $lbl_site_name $config["Company"]["company_name"]), "home.php"); 


in this remove the "home.php " and leave it blank or provide a link as you like.

edawlem 09-25-2009 09:43 AM

Re: Breadcrumb Home Link
 
This code is not in the auth.php file in 4.2

edawlem 09-25-2009 10:09 AM

Re: Breadcrumb Home Link
 
I found what I needed here.

I'm hoping that covers everything... ??

JWait 10-11-2009 07:15 AM

Re: Breadcrumb Home Link
 
How do I change the "company name" (x-cart root) name to simply "Home" in version 4.2.2? I've done this in 4.1.x versions but the code is different.

Also, how do I change the "::" in the page title?

cflsystems 10-11-2009 07:34 AM

Re: Breadcrumb Home Link
 
1. (never tried this one) In root/postauth.php find

$location[] = array((!empty($lbl_site_name) ? $lbl_site_name : $config["Company"]["company_name"]), "home.php");

and replace $config["Company"]["company_name"] with your wording

2. In root/include/func/func.core.php find

$html_page_title = implode(' :: ', $tmp);

and replace :: with your symbol

JWait 10-11-2009 08:15 AM

Re: Breadcrumb Home Link
 
$html_page_title = implode(' - ', $tmp); worked (although it took a little while to find)

Changing the postauth.php seems to remove the "root" (home.php) from the breadcrumb entirely. All I want to do is have it say something other than "our company name". This was done in v4.1.x as follows
Code:

{* $Id: location.tpl,v 1.14.2.2 2007/06/18 11:42:03 max Exp $ *}
{if $location}
<br />
<span class="NavigationPath">
{strip}
{section name=position loop=$location}
{* {if $location[position].1 ne "" }<a href="{$location[position].1|amp}" class="NavigationPath">{/if} *}
{if $location[position].1 ne "" }{if $location[position].0 ne $config.Company.company_name}<a href="{$location[position].1}" class="NavigationPath">{else}<a href="{$http_location}/" class="NavigationPath">{/if}{/if}

{if $location[position].0 eq $config.Company.company_name}
Home
{else}
{$location[position].0}
{/if}
{if $location[position].1 ne "" }</a>{/if}
{if not %position.last%}&nbsp;\&nbsp;{/if}
{/section}
{/strip}
</span>
<br /><br />
{/if}


but 4.2 doesn't seem to use "location.tpl" (at least it doesn't seem to change anything when I change it)

cflsystems 10-11-2009 10:20 AM

Re: Breadcrumb Home Link
 
It does work the way I posted it - replacing the $config["Company"]["company_name"] with whatever you want it to say

Here is the line I just tried and it works

$location[] = array((!empty($lbl_site_name) ? $lbl_site_name : "Home"), "home.php");

JWait 10-12-2009 03:27 AM

Re: Breadcrumb Home Link
 
That works, but it is not what I am looking for. It renames the site title to "Home". All I want is the breadcrumb to say "Home" for the root instead of the company name.

autobulbs 10-16-2009 07:59 AM

Re: Breadcrumb Home Link
 
in customer/bread_crumbs.tpl

replace

Code:

      {foreach from=$location item=l name=location}

with

Code:

      {foreach from=$location item=l name=location}
      {if $l.0 eq $config.Company.company_name}
          {assign var="locprint" value="Home"}
      {else}
          {assign var="locprint" value=$l.0}
      {/if}


JWait 10-16-2009 10:27 AM

Re: Breadcrumb Home Link
 
That didn't work either :(

cflsystems 10-16-2009 11:49 AM

Re: Breadcrumb Home Link
 
This works, added code in red
Code:


{foreach from=$location item=l name=location}
  {if $l.1 && !$smarty.foreach.location.last}
        {if $l.0 eq $config.Company.company_name}
            <a href="{$l.1|amp}">Home</a>
        {else}
            <a href="{$l.1|amp}">{if $webmaster_mode eq "editor"}{$l.0}{else}{$l.0|escape}{/if}</a>
        {/if}
  {else}
    <span class="current">{if $webmaster_mode eq "editor"}{$l.0}{else}{$l.0|escape}{/if}</span>
  {/if}
  {if !$smarty.foreach.location.last}
    <span>╩</span>
  {/if}
  {/foreach}


JWait 10-16-2009 01:18 PM

Re: Breadcrumb Home Link
 
I appreciate the help, and that last one changed the "company name" to "Home", but now the links don't work.

JWait 10-16-2009 01:43 PM

Re: Breadcrumb Home Link
 
I got it. I had to add a <br /> tag because of the "hidden" JavaScript warning.... got the styles to work too.
Code:

{*
$Id: bread_crumbs.tpl,v 1.5.2.1 2009/04/01 10:37:47 avg Exp $
vim: set ts=2 sw=2 sts=2 et:
*}
<br />
{if $location}
  <div id="location"><br />
  {foreach from=$location item=l name=location}
  {if $l.1 && !$smarty.foreach.location.last}
        {if $l.0 eq $config.Company.company_name}
            <a href="{$l.1|amp}" class="bread-crumb{if $smarty.foreach.location.last} last-bread-crumb{/if}">Home</a>
        {else}
            <a href="{$l.1|amp}" class="bread-crumb{if $smarty.foreach.location.last} last-bread-crumb{/if}">{if $webmaster_mode eq "editor"}{$l.0}{else}{$l.0|escape}{/if}</a>
        {/if}
  {else}
    <span class="current">{if $webmaster_mode eq "editor"}{$l.0}{else}{$l.0|escape}{/if}</span>
  {/if}
  {if !$smarty.foreach.location.last}
    <span> \ </span>
  {/if}
  {/foreach}
    </div>
{/if}


cflsystems 10-16-2009 07:01 PM

Re: Breadcrumb Home Link
 
Well that was a hard one :) Glad you got it working.

JWait 10-22-2009 01:47 PM

Re: Breadcrumb Home Link
 
It seems to work in 4.3 as well.

Thanks!

Mathfly 10-24-2009 06:28 AM

Re: Breadcrumb Home Link
 
Thanks for these infos ....

I was following this thread trying to do the same thing... Here is what worked better for me in 4.2.X... or else I was still getting my "Company Name" in the bread crumb on the first Home page.

Then just have the { if $l.0 ....} before the { if $l.1 ....} loop.

Code:

{*
$Id: bread_crumbs.tpl,v 1.5.2.1 2009/04/01 10:37:47 avg Exp $
vim: set ts=2 sw=2 sts=2 et:
*}
{if $location}
    <div id="location">
            {foreach from=$location item=l name=location}
                  {if $l.0 eq $config.Company.company_name}
                    <a href="{$l.1|amp}" class="bread-crumb{if $smarty.foreach.location.last} last-bread-crumb{/if}">Home</a>
                {else}
                        {if $l.1 && !$smarty.foreach.location.last}
                            <a href="{$l.1|amp}" class="bread-crumb{if $smarty.foreach.location.last} last-bread-crumb{/if}">{if $webmaster_mode eq "editor"}{$l.0}{else}{$l.0|escape}{/if}</a>
                        {else}
                          <font class="bread-crumb{if $smarty.foreach.location.last} last-bread-crumb{/if}">{if $webmaster_mode eq "editor"}{$l.0}{else}{$l.0|escape}{/if}</font>
                        {/if}
                    {/if}
                    {if !$smarty.foreach.location.last}
                        <span>::</span>
                    {/if}
              {/foreach}
      </div>
{/if}


wites 03-19-2013 06:08 PM

Re: Breadcrumb Home Link
 
Hi! How did you solve problem with breadcrumbs home link? I have the same issue i need Home link to go to main domain of the website instead of the xcart folder. thanks

Quote:

Originally Posted by edawlem
I found what I needed here.

I'm hoping that covers everything... ??



All times are GMT -8. The time now is 07:57 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.