Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Remove product title in location.tpl

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 01-08-2008, 02:18 AM
 
qrichou qrichou is offline
 

Advanced Member
  
Join Date: Oct 2007
Posts: 39
 

Default 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
Reply With Quote
  #2  
Old 01-08-2008, 02:53 AM
  Ene's Avatar 
Ene Ene is offline
 

X-Cart team
  
Join Date: Aug 2004
Posts: 907
 

Default 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"],""); 
__________________
Eugene Kaznacheev,
Evangelist/Product Manager at Ecwid: http://www.ecwid.com/ (since Sept 2009)

ex-Head of X-Cart Tech Support Department
ex- X-Cart Hosting Manager - X-Cart hosting
ex-X-Cart Technical Support Engineer


Note: For the official guaranteed tech support services please turn to the Customers HelpDesk.
Reply With Quote

The following user thanks Ene for this useful post:
jully147 (04-08-2009)
  #3  
Old 01-08-2008, 04:02 AM
 
qrichou qrichou is offline
 

Advanced Member
  
Join Date: Oct 2007
Posts: 39
 

Default Re: Remove product title in location.tpl

ah great thanks Ene worked perfectly.
Reply With Quote
  #4  
Old 04-11-2008, 03:23 AM
 
qrichou qrichou is offline
 

Advanced Member
  
Join Date: Oct 2007
Posts: 39
 

Default 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
Reply With Quote
  #5  
Old 04-11-2008, 03:39 AM
  kube's Avatar 
kube kube is offline
 

X-Adept
  
Join Date: Sep 2005
Location: London: a small place East of Wales
Posts: 529
 

Default 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.
__________________
Doms
kube v4.1.9
Reply With Quote
  #6  
Old 04-11-2008, 04:52 AM
  kube's Avatar 
kube kube is offline
 

X-Adept
  
Join Date: Sep 2005
Location: London: a small place East of Wales
Posts: 529
 

Default 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.
__________________
Doms
kube v4.1.9
Reply With Quote
  #7  
Old 04-11-2008, 05:55 AM
 
qrichou qrichou is offline
 

Advanced Member
  
Join Date: Oct 2007
Posts: 39
 

Default 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?
Reply With Quote
  #8  
Old 04-11-2008, 08:34 AM
  kube's Avatar 
kube kube is offline
 

X-Adept
  
Join Date: Sep 2005
Location: London: a small place East of Wales
Posts: 529
 

Default 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
__________________
Doms
kube v4.1.9
Reply With Quote
  #9  
Old 04-15-2008, 12:57 PM
 
inmotionmedia inmotionmedia is offline
 

Newbie
  
Join Date: Jun 2007
Posts: 8
 

Default 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!
__________________
In Motion Media
Reply With Quote
  #10  
Old 04-15-2008, 01:03 PM
  kube's Avatar 
kube kube is offline
 

X-Adept
  
Join Date: Sep 2005
Location: London: a small place East of Wales
Posts: 529
 

Default 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.
__________________
Doms
kube v4.1.9
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 12:00 PM.

   

 
X-Cart forums © 2001-2020