rethus Posted February 10, 2011 Share Posted February 10, 2011 I search for a way to use styling elements in the Category-Description.Is there a way to use it?If i enter or other tags, after saving all those tags are gone. Only the tag is still in this Sourcecode.BTW: How can i set the Category-Description to the bottom of the page, or add another description-field for the categories? Link to comment Share on other sites More sharing options...
annunakiwww Posted March 16, 2011 Share Posted March 16, 2011 To your first question, there is a solution yes, although it involves editing core files. Solution thanks to:http://www.prestashop.com/forums/viewthread/21118/P30/#261603This is a translated version of his solution: Bonjour,You only have to modify one file:in classes/Category.php line 98 function "getTranslationsFieldsChild" :replace : public function getTranslationsFieldsChild() { parent::validateFieldsLang(); return parent::getTranslationsFields(array('name', 'description', 'link_rewrite', 'meta_title', 'meta_keywords', 'meta_description')); } by : public function getTranslationsFieldsChild() { self::validateFieldsLang(); $fieldsArray = array('name', 'link_rewrite', 'meta_title', 'meta_keywords', 'meta_description'); $fields = array(); $languages = Language::getLanguages(); $defaultLanguage = Configuration::get('PS_LANG_DEFAULT'); foreach ($languages as $language) { $fields[$language['id_lang']]['id_lang'] = $language['id_lang']; $fields[$language['id_lang']][$this->identifier] = intval($this->id); $fields[$language['id_lang']]['description'] = (isset($this->description[$language['id_lang']])) ? Tools::htmlentitiesDecodeUTF8(pSQL($this->description[$language['id_lang']], true)) : ''; foreach ($fieldsArray as $field) { if (!Validate::isTableOrIdentifier($field)) die(Tools::displayError()); /* Check fields validity */ if (isset($this->{$field}[$language['id_lang']]) AND !empty($this->{$field}[$language['id_lang']])) $fields[$language['id_lang']][$field] = pSQL($this->{$field}[$language['id_lang']]); elseif (in_array($field, $this->fieldsRequiredLang)) $fields[$language['id_lang']][$field] = pSQL($this->{$field}[$defaultLanguage]); else $fields[$language['id_lang']][$field] = ''; } } return $fields; } It works under 1.2.4, 1.2.5 and reportedly also under 1.3 1 Link to comment Share on other sites More sharing options...
bellini13 Posted April 20, 2011 Share Posted April 20, 2011 also works under 1.4, thanks ! Link to comment Share on other sites More sharing options...
SonnyBoyII Posted May 12, 2011 Share Posted May 12, 2011 The code modyfication works perfectly under the PS1.6 version. Now I can use html tags Link to comment Share on other sites More sharing options...
Stefand Posted June 4, 2011 Share Posted June 4, 2011 Thanks, this work under 1.4But how can I get the tinymc editor on it? Link to comment Share on other sites More sharing options...
jellygnite Posted September 23, 2011 Share Posted September 23, 2011 Thanks, this work under 1.4 But how can I get the tinymc editor on it? See here for solution http://www.prestashop.com/forums/topic/116343-solved-how-to-use-html-in-catagory-descriptions/ and http://www.jellygnite.com.au/blog/index.php/archive/update-display-html-in-prestashop-category-description-v-1-4/ Link to comment Share on other sites More sharing options...
Usman Ahmed Posted October 4, 2011 Share Posted October 4, 2011 Thanks annunakiwww. Now I can add link to description and make my internal linking more efficient. Link to comment Share on other sites More sharing options...
Noyes Posted August 6, 2012 Share Posted August 6, 2012 (edited) I would like to warn and say this does not fully work with the current versions of PrestaShop (it does if you read the edit-part below!). Sure, it can create links ( <a href="http://www.google.com/">Testlänk</a> ). But when looking at the source code it looks like this: It doesn't look really right.. anyone got a solution for this or does it acutally matter? -- Edit: Now when I removed the code and replaced it with the old one the link still remains in the description and the source code looks a lot more clean. So a simple but a bit amateurish solution would be to use the code when you wanna edit the description with HTML-tags, save the description and then replace the new code with the old one (referring to the category.php code in /classes/). Edited August 6, 2012 by Noyes (see edit history) Link to comment Share on other sites More sharing options...
perusi Posted February 25, 2013 Share Posted February 25, 2013 does anyone know a solution for PS 1.5.3.1? thanks Link to comment Share on other sites More sharing options...
ali97rey Posted August 17, 2021 Share Posted August 17, 2021 On 2/10/2011 at 4:31 PM, rethus said: I search for a way to use styling elements in the Category-Description. Is there a way to use it? If i enter or other tags, after saving all those tags are gone. Only the tag is still in this Sourcecode. BTW: How can i set the Category-Description to the bottom of the page, or add another description-field for the categories? Found a solution: Prestashop 1.7.7.4 This is already solved in classes/category.php model with a method called getDescriptionClean(). You just need to do a trick in tpl files. Where ever you want to use category description you need to write like this: {$category.description nofilter} Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now