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

Category Titles

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 10-30-2006, 10:05 AM
 
nevets1219 nevets1219 is offline
 

eXpert
  
Join Date: Jun 2006
Posts: 351
 

Default Category Titles

Recently just ran a test import in 4.1.3 and at first I noticed that category titles are not using & in place of & which I thought would be a minor issue if I just change the titles to use & when I import via CSV (3.x-4.x method) instead and that is what I did. But when I'm browsing in a category with subcategoires I would see & instead of & in the subcategory which is a problem.

I've looked in ../skin1/customer/main/subcategories.tpl but that one is "escaped" which is what I believe what I need to do. It is the bar on the left side with all the root categories that is not "escaped". So I made the change to ../skin
1/customer/categories.tpl
from
Code:
{$c.category}
and changed it to
Code:
{$c.category|escape}
I'm wondering if this change will produce any unwanted effects.
__________________
4.1.8
Reply With Quote
  #2  
Old 11-02-2006, 12:08 PM
 
nevets1219 nevets1219 is offline
 

eXpert
  
Join Date: Jun 2006
Posts: 351
 

Default Re: Category Titles

Any help would be greatly appreciated.
__________________
4.1.8
Reply With Quote
  #3  
Old 11-07-2006, 05:24 PM
 
geckoday geckoday is offline
 

X-Wizard
  
Join Date: Aug 2005
Posts: 1,073
 

Default Re: Category Titles

Not a problem. That is what X-Cart should have done in the first place.
__________________
Manuka Bay Company
X-Cart Version 4.0.19 [Linux]

UGG Boots and other fine sheepskin products
http://www.snowriver.com
Reply With Quote
  #4  
Old 11-07-2006, 06:12 PM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default Re: Category Titles

Works here. Great idea. Except it breaks CDSEO in the page titles... I'm sure I can find a cure for this.

If we report this to x-cart, can I get my points back for what they claim was a "feature" of xcart? I'll argue with them next week. I'm too tired.
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
  #5  
Old 11-08-2006, 10:42 AM
 
nevets1219 nevets1219 is offline
 

eXpert
  
Join Date: Jun 2006
Posts: 351
 

Default Re: Category Titles

Hmm...we'll probably be getting CDSEO soon, so if you figure something out, we'd be interested in seeing it too.

Thanks for the replies!
__________________
4.1.8
Reply With Quote
  #6  
Old 11-08-2006, 04:18 PM
 
nevets1219 nevets1219 is offline
 

eXpert
  
Join Date: Jun 2006
Posts: 351
 

Default Re: Category Titles

Sorry for the double post! But I found some additional information.

I've noticed some additional files that may need editing. I have a skin from X-Cart so it may not necessary apply to everyone.

The following files may / may not require change:
Quote:
dialog.tpl
dialog_printable.tpl
location.tpl -- this file shows Root Category :: Sub Category :: Sub Category
I'll add more list to this as I find them.

I'm rather confused about location.tpl since it uses
Quote:
{$location[position].1|amp}
The amp is particularly confusing because I assume it to be something from Smarty but searching the Smarty documentation for amp yields no results.

EDIT: While I'm on this, my Webmaster Mode seems to have broken slightly whereas it was working fine before. I'm not sure exactly what affected it. Could clearing the cache help?
__________________
4.1.8
Reply With Quote
  #7  
Old 11-08-2006, 06:10 PM
 
geckoday geckoday is offline
 

X-Wizard
  
Join Date: Aug 2005
Posts: 1,073
 

Default Re: Category Titles

Quote:
Originally Posted by nevets1219
The amp is particularly confusing because I assume it to be something from Smarty but searching the Smarty documentation for amp yields no results.

Its a custom Smarty modifier that X-Cart introduced in 4.1. You can find it in include/templater/plugins/modifier.amp.php. All it does is convert any '&' not followed by 'amp;' to '&'. Pretty silly in my book. They should be using escape. But I guess they want to let people use '&' in their category titles but not ' ' or ''' etc. They really should choose - either you can use HTML in the titles or you can't. If you can't everything should go through escape. If you can leave it alone and its up to whoever is entering it to get it right.
__________________
Manuka Bay Company
X-Cart Version 4.0.19 [Linux]

UGG Boots and other fine sheepskin products
http://www.snowriver.com
Reply With Quote
  #8  
Old 11-08-2006, 06:21 PM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default Re: Category Titles

Ralph, you made my night with this discovery!

Quote:
But I guess they want to let people use '&' in their category titles but not ' ' or ''' etc

Or (trademark)

-- that was supposed to read:
Code:
& # 8482; (lose the space before and after the & and # -- vBulletin is parsing this as html)

I'm on deadline for a tradeshow, or i would dig deaper into this tonight. It will have to wait a few days... but i'll re-visit this thread soon! Can't wait...
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
  #9  
Old 11-09-2006, 08:46 AM
 
nevets1219 nevets1219 is offline
 

eXpert
  
Join Date: Jun 2006
Posts: 351
 

Default Re: Category Titles

OK, then I believe location.tpl should go from
Code:
{* $Id: location.tpl,v 1.14 2005/11/17 06:55:36 max Exp $ *} {if $location} <font class="NavigationPath"> {strip} {section name=position loop=$location} {if $location[position].1 ne "" }<a href="{$location[position].1|amp}">{/if} {$location[position].0} {if $location[position].1 ne "" }</a>{/if} {if not %position.last%}&nbsp;::&nbsp;{/if} {/section} {/strip} </font> <br /><br /> {/if}
to
Code:
{* $Id: location.tpl,v 1.14 2005/11/17 06:55:36 max Exp $ *} {if $location} <font class="NavigationPath"> {strip} {section name=position loop=$location} {if $location[position].1 ne "" }<a href="{$location[position].1|amp}">{/if} {$location[position].0|amp} {if $location[position].1 ne "" }</a>{/if} {if not %position.last%}&nbsp;::&nbsp;{/if} {/section} {/strip} </font> <br /><br /> {/if}
Would you recommend I forget the amp and just use esacpe? If I understand you correctly, amp will ONLY convert & to &amp; but leave everything else as raw text, whereas escape will convert everything not just & (ie & to &amp; but it leaves &amp; alone as plain text). Seems like both does the same thing but escape does more.
__________________
4.1.8
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:24 AM.

   

 
X-Cart forums © 2001-2020