| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | Mark Forums Read | User manuals | Login |
re: default/en/category_description.tpl | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
re: default/en/category_description.tpl
our store has approximately 350 categories where the description field has been filled out with the exact same text as the category title, thus we get
CATEGORY TITLE category title duplicate text on many pages. I would like to modify this file so that it detects when they are the same and if so, display nothing .. i.e. do not even include the markup for the HTML Code:
I've been following the tutorial here, but since I don't get a result back from Code:
I am a little confused as to how to proceed, as well as still a bit sketchy on how to write the smarty code.. I can probably figure out the smarty code on my own, but as for the rest, what is the correct way to override this file -- it contains no @ListChild .. and the documentation only describes the single instance where it does.
__________________
-- Scott Godin |
|||||||||
#2
|
|||||||||
|
|||||||||
Re: default/en/category_description.tpl
If you look at the code of default/en/category_description.tpl template file, you will see the following code there:
Code:
To implement the feature in question, first you need to customize the template code as follows: Code:
Additionally, you will need to customize the following class/method: classes/XLite/View/Category.php Code:
So that if category description is equal to category title, then return an empty string ''. See also: * Developer docs
__________________
Sincerely yours, Sergey Fomin X-Cart team Chief support group engineer === Check this out. Totally revamped X-Cart hosting http://www.x-cart.com/hosting.html Follow us: https://twitter.com/x_cart / https://www.facebook.com/xcart / https://www.instagram.com/xcart |
|||||||||
#3
|
|||||||||
|
|||||||||
Re: default/en/category_description.tpl
http://kb.x-cart.com/display/XDD/Step+2+-+applying+design+changes
1. So insofar as the .tpl is concerned, you're saying that even though it has no @ListChild, I can still override the template file in the manner described above ? 2. I don't see anything on smarty.net regarding the isVisible() -- is this something specific to X-Cart 5? 3. I'm still working through the docs in this section on how to override the MVC classes via module. I'll get back to you on this bit if I remain stuck.
__________________
-- Scott Godin |
|||||||||
#4
|
|||||||||
|
|||||||||
Re: default/en/category_description.tpl
Quote:
the trace shows the following, http://i67.tinypic.com/be9geo.jpg however, adding Code:
to my module's runBuildCacheHandler() does not seem to remove that template file from the default skin. The docs in the link don't get into detail on what to do in this case, or at least not in a way I am yet understanding. We need to expand that section of the docs to include instances such as this, for greater clarification of what's necessary. Meanwhile, I still need to know how to do this. Can you clarify?
__________________
-- Scott Godin |
|||||||||
#5
|
|||||||||
|
|||||||||
Re: default/en/category_description.tpl
X-Cart 5 does not use Smarty. It uses Flexy.
If you would like to change any template, use "Webmaster mode" tool (Look & Feel >> Webmaster mode), do not use "Webmaster Kit" module (it is actually a legacy module).
__________________
Sincerely yours, Sergey Fomin X-Cart team Chief support group engineer === Check this out. Totally revamped X-Cart hosting http://www.x-cart.com/hosting.html Follow us: https://twitter.com/x_cart / https://www.facebook.com/xcart / https://www.instagram.com/xcart |
|||||||||
#6
|
|||||||||
|
|||||||||
Re: default/en/category_description.tpl
Besides, you need to create a custom module that would change the logic of the getDescription() method of the class "classes/XLite/View/Category.php, as mentioned earlier.
__________________
Sincerely yours, Sergey Fomin X-Cart team Chief support group engineer === Check this out. Totally revamped X-Cart hosting http://www.x-cart.com/hosting.html Follow us: https://twitter.com/x_cart / https://www.facebook.com/xcart / https://www.instagram.com/xcart |
|||||||||
#7
|
|||||||||
|
|||||||||
Re: default/en/category_description.tpl
Quote:
Yes, I have noted that distinction, when looking for Smarty functionality that doesn't exist in Flexy and figured it out from there. Quote:
with that being the case, I would highly recommend updating the documentation that I referenced from the knowledgebase to reflect this, as well as deprecating the module if you are phasing it out, so that it no longer runs on current Xcart, and shows up in the module list as not-compatible. I would like to point out that I was only following the instructions in your own documentation
__________________
-- Scott Godin |
|||||||||
#8
|
|||||||||
|
|||||||||
Re: default/en/category_description.tpl
Quote:
I have created a custom module. I have successfully overridden .tpl files with my own versions (such as the footer in the Clothing template) that posess an @ListChild directive in their content. This template file does not posess an @ListChild directive, and following the instructions I have already used to do so in the past, does not work for this instance. Your documentation should clarify that "in the case where this, you need to move on to the next segment _here_, to achieve that goal", as well as being updated to no longer reference the use of Webmaster Kit module. However using webmaster mode to override a template file with no @ListChild does not make it part of your own module, which was, I thought, the whole point of the exercise -- to keep things organized, prevent updates from overwriting, and keep your changes from being scattered all over the place.
__________________
-- Scott Godin |
|||||||||
#9
|
|||||||||
|
|||||||||
Re: default/en/category_description.tpl
using Webmaster Mode to merely append a 'test' class to the markup in the template resulted in the following:
HTML Code:
clearly not what I had in mind. looking at it in vim, positioning the cursor over the space, and pressing 'ga' gives me the result that the character under the cursor is not an ASCII 32 (space) but in fact a unicode no-break space Hex 00a0 http://www.fileformat.info/info/unicode/char/00a0/index.htm in addition to the fact that my spacebar was autoconverted without my specific intent to type such a character, it would also appear that I am UNABLE to copy an EXISTING space character from elsewhere on that very edit block and PASTE it in where I want it. The window refuses utterly to even copy the space character -- i have to select surrounding characters and then delete them from around the space I want after I paste it.
__________________
-- Scott Godin |
|||||||||
#10
|
|||||||||
|
|||||||||
Re: default/en/category_description.tpl
so far every attempt I've made to replace Xlite/View/Category.php with my module's Xlite/Module/MHG/TemplateMods/View/Category.php either breaks the store forcing me to do a soft reset, or simply fails to do anything.
Not sure what I'm doing wrong. Does the documentation need updating? I've updated the template file to use this, via theme_tweaker (though I would much rather have this edited template file as part of my module, since I'm using my module to override it!) Code:
and then added the following to my module (a stripped down and edited copy of Xlite\View\Category.php ) Code:
I have also tried doing it with Code:
__________________
-- Scott Godin |
|||||||||
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|