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)
-   -   Remove product title in location.tpl (https://forum.x-cart.com/showthread.php?t=36599)

qrichou 01-08-2008 02:18 AM

Remove product title in location.tpl
 
Hi all,

Does anyone know how i can remove the product title from the breadcrumb do i have to edit location.tpl?

Many Thanks

Richie

Ene 01-08-2008 02:53 AM

Re: Remove product title in location.tpl
 
Edit the 'product.php' script, replace:

PHP Code:

if (!empty($product_info)) $location[] = array($product_info["product"],""); 


with

PHP Code:

# if (!empty($product_info)) $location[] = array($product_info["product"],""); 


qrichou 01-08-2008 04:02 AM

Re: Remove product title in location.tpl
 
ah great thanks Ene worked perfectly.

qrichou 04-11-2008 03:23 AM

Re: Remove product title in location.tpl
 
Hi,

Although this removes the product title from the breadcrumb it also removes it from the page title which is rubbish for SEO.

I didnt realise but the page titles(home.tpl) are built from the breadcrumb(location.tpl) is there any way around this does anyone know of a solution?

So is there a way of hiding the product title in the breadcrumb but showing it in the page titles?


Many thanks in advance

kube 04-11-2008 03:39 AM

Re: Remove product title in location.tpl
 
Quote:

Originally Posted by qrichou
So is there a way of hiding the product title in the breadcrumb but showing it in the page titles?


A quick rehash (including warts and all) of location.tpl for you...

PHP Code:

{if $location}
<
font class="NavigationPath">
{
strip}
{
section name=position loop=$location}
{if 
not %position.last%}
{if 
$location[position].1 ne "" }<a href="{$location[position].1|amp}class="NavigationPath">{/if}
{
$location[position].0}
{if 
$location[position].1 ne "" }</a>{/if} &gt; {/if}
{/
section}
{/
strip}
</
font>
<
br /><br />
{/if} 


Hope this helps.
==========================
Edit: Note: It will always remove the current area. For example, it will remove the breadcrumb from the home page or the current category you reside in on a page.

kube 04-11-2008 04:52 AM

Re: Remove product title in location.tpl
 
Another quick rehash at the tpl level, but this time to specifically remove the product name on just the product page...

PHP Code:

{strip}
{
section name=position loop=$location}
{if 
not %position.last%}
{if 
$location[position].1 ne "" }<a href="{$location[position].1|amp}class="NavigationPath">{/if}
{
$location[position].0}
{if 
$location[position].1 ne "" }</a> &gt; {/if}
{elseif 
not $product}
{if 
$location[position].1 ne "" }<a href="{$location[position].1|amp}class="NavigationPath">{/if}
{
$location[position].0}
{if 
$location[position].1 ne "" }</a> &gt; {/if}
{/if}
{/
section}
{/
strip


Might want to clean up the if statements though. Some of the section's attributes might produce cleaner code but unable to make it work at the moment.

qrichou 04-11-2008 05:55 AM

Re: Remove product title in location.tpl
 
hey thanks, your update works may look into cleaning up the second example many thanks though :-)

I didnt know you could use section attributes?

kube 04-11-2008 08:34 AM

Re: Remove product title in location.tpl
 
Section attributes...
http://www.smarty.net/manual/en/language.function.section.php

And another crack at tpl level for removing the product name on the product page's breadcrumb (a little cleaner, no idea if it is quicker though)...

PHP Code:

{assign var=to_be_displayed value=$smarty.section.position.loop}
{if 
$product}{math assign="to_be_displayed" equation="x-1" x=$smarty.section.position.loop}{/if}
{
strip}
{
section name=position loop=$location max=$to_be_displayed}
{if 
$location[position].1 ne "" }<a href="{$location[position].1|amp}class="NavigationPath">{/if}
{
$location[position].0}
{if 
$location[position].1 ne "" }</a>{/if}
{if 
not %position.last%} &gt; {/if}
{/
section}
{/
strip


inmotionmedia 04-15-2008 12:57 PM

Re: Remove product title in location.tpl
 
Do you also know how to do the opposite? I want to remove the Shop name (First breadcrumb) from the breadcrumbs. I'm affraid that the breadcrumb gets to wide since i changed it into a bigger font.

Thanks!

kube 04-15-2008 01:03 PM

Re: Remove product title in location.tpl
 
Hi inmotionmedia,

add the start attribute to the section (I've also removed the outer lying FONT tags as they'll get printed on the home page as an empty tag)

Code:

{if $location}
{strip}
{section name=position loop=$location start=1}
{if $location[position].1 ne "" }<a href="{$location[position].1|amp}" class="NavigationPath">{/if}
{$location[position].0}
{if $location[position].1 ne "" }</a>{/if}
{if not %position.last%} &gt; {/if}
{/section}
{/strip}
{/if}


If you need the FONT tags find the appropriate IF statement to exclude breadcrumbs from the home page

Hope this helps.


All times are GMT -8. The time now is 11:22 AM.

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