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)

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 08:02 PM.

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