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)
-   -   Category Titles (https://forum.x-cart.com/showthread.php?t=26237)

nevets1219 10-30-2006 10:05 AM

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.

nevets1219 11-02-2006 12:08 PM

Re: Category Titles
 
Any help would be greatly appreciated.

geckoday 11-07-2006 05:24 PM

Re: Category Titles
 
Not a problem. That is what X-Cart should have done in the first place.

carpeperdiem 11-07-2006 06:12 PM

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. ;)

nevets1219 11-08-2006 10:42 AM

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!

nevets1219 11-08-2006 04:18 PM

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?

geckoday 11-08-2006 06:10 PM

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.

carpeperdiem 11-08-2006 06:21 PM

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...

nevets1219 11-09-2006 08:46 AM

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.


All times are GMT -8. The time now is 10:21 AM.

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