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

Can I hide the active category/product name in location.tpl?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 03-31-2006, 10:52 AM
 
brettcta brettcta is offline
 

Newbie
  
Join Date: Mar 2006
Location: Chicago, IL
Posts: 5
 

Default Can I hide the active category/product name in location.tpl?

Hello. I've been looking around for a tip on this to no avail.

I'm finding the default format of location.tpl to be redundant. If the customer is in this category path:

Home/Media Types/Audio

then I want location.tpl to show only:

Home :: Media Types

because the active category, Audio, is already displayed immediately below location.tpl.

This is even more significant when looking at products, since I have a number of products with fairly long titles that can't really be abbreviated (book titles, etc). When they're displayed in location.tpl, the text of the longer titles wraps, which looks sloppy as well as redundant. For example, if the customer is viewing the product details at this path:

Home/Media Types/Books/"Manufacturing Consent - The Political Economy of the Mass Media - Herman & Chomsky"

then I want location.tpl to only display:

Home :: Media Types :: Books

as opposed to the entire path with product name.

At the very least, if its easier to just eliminate the :: (product name) portion from location.tpl, that's fine by me, as I can get along fine with having the active category showing. It's mainly the product in location.tpl that I want to get rid of. Unfortunately, after messing around with it for a while now, I still haven't figured out how to do it (hence this post).

If anyone has any advice on how to modify location.tpl to achieve this, or if there is already a mod to accomplish this that someone might forward me to, I'd greatly appreciate it. Thanks!!

And thanks to TelaFirma and balinor for two other mods that I've incorporated to make location.tpl a little more user friendly! Which reminds me, this is the code I currently am using for location.tpl, in case it helps:

Code:
{if $location} <FONT class="NavigationPath"> {strip} Home:: {section name=position loop=$location start=1} {if $location[position].1 ne "" }<A href="{$location[position].1}" class="NavigationPath">{/if} {$location[position].0} {if $location[position].1 ne "" }</A>{/if} {if not %position.last%}::{/if} {/section} {/strip} </FONT> {/if}
__________________
-----
X-Cart Gold 4.0.18
Reply With Quote
  #2  
Old 03-31-2006, 12:50 PM
 
brettcta brettcta is offline
 

Newbie
  
Join Date: Mar 2006
Location: Chicago, IL
Posts: 5
 

Default One solution to hide active category/product in location.tpl

I mucked around with my quandry a bit and came up with the following, which does seem to accomplish both goals I mention above.

However, the position divider - in this case :: - becomes part of the following position's hyperlink. With the default skin1 font class=NavigationPath, this effectively makes the dividers the same color as the positions, (along with hover colors, etc). For the time being, I'm just going to create a new class in skin1 so I can maintain the appearance of NavigationPath in location.tpl but avoid having this appearance on hover (in this case, when hovering over category "Media Types", sans color):

Home :: Media Types :: Books

However, this does successfully eliminate the active category from showing up (as well as its subsequent divider), in addition to eliminating a product title from showing up when viewing that product. If you might have a suggestion as to how to keep the divider from being affected in this way, please let me know.

Anyway, this is the code I ended up with, which doesn't completely disresemble a long, strandy type of pasta, IMO:

Code:
{if $location} <FONT class="NavigationPath"> {strip} Home {section name=position loop=$location start=1} {if $location[position].1 ne "" } <A href="{$location[position].1}" class="NavigationPath">{/if} {if not %position.last%} ::{$location[position].0} {if $location[position].1 ne "" }</A>{/if} {/if} {/section} {/strip} </FONT> {/if}
__________________
-----
X-Cart Gold 4.0.18
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 02:51 PM.

   

 
X-Cart forums © 2001-2020