cjrent Posted August 21, 2013 Share Posted August 21, 2013 In order to allow html formatting in my short description, I've changed my product-list.tpl from <p class="product_desc"><a href="{$product.link|escape:'htmlall':'UTF-8'}" title="{$product.description_short|strip_tags:'UTF-8'|truncate:360:'...'}" >{$product.description_short|strip_tags:'UTF-8'|truncate:360:'...'}</a></p> to <p class="product_desc"> <a href="{$product.link|escape:'htmlall':'UTF-8'}" title="{$product.description_short|strip_tags:'UTF-8'|truncate:360:'...'}" >{$product.description_short|truncate:360:'...'}</a> </p> However, it seems that extra <p> tags get inserted when I do this. Is it possible to avoid this, as it makes the visual formatting of the product list page to be off. Rumor has it that TinyMCE is adding these extra <p> tags. Is it possible to stop it from doing that? (see post #3 here: http://www.prestasho...post__p__300663) I tried the fix from Post #7, but that didn't work. Many thanks. Link to comment Share on other sites More sharing options...
vekia Posted August 22, 2013 Share Posted August 22, 2013 in this case it is necessary to modify the tinymce init function, check this: http://www.tinymce.com/wiki.php/Configuration:force_p_newlines Link to comment Share on other sites More sharing options...
cjrent Posted August 23, 2013 Author Share Posted August 23, 2013 Where would I find that file in order to make the change? Sorry if this is a silly question, but I'm still getting the hang of this. Link to comment Share on other sites More sharing options...
vekia Posted August 23, 2013 Share Posted August 23, 2013 take a look here: ADMIN_DIR/themes/default/template/controllers/products/helpers/form/form.tpl you have there tinymce objec SETUP definition: tinySetup({ editor_selector :"autoload_rte", change it to: tinySetup({ editor_selector :"autoload_rte", force_p_newlines : false, force_br_newlines : true, voila 1 Link to comment Share on other sites More sharing options...
cjrent Posted August 23, 2013 Author Share Posted August 23, 2013 Thank you Vekia. Honestly I don't know what I'd do without you folks on this forum. I'd be completely lost. Link to comment Share on other sites More sharing options...
vekia Posted August 23, 2013 Share Posted August 23, 2013 thank you for your kind words, i really appreciate it im going to mark this topic as [sOLVED] if you will have any additional questions - feel free to write best regards Link to comment Share on other sites More sharing options...
zeisei Posted August 29, 2014 Share Posted August 29, 2014 (edited) Hello Vekia, I tried this in my 1.5.4.1 site, but it didnt work (I emptied cache and forced compile). Is it perhaps because i use another external theme? I need to remove <p> to avoid validation errors since i force the short description as an H2 tag Thank you. [solved:I replaced '{$product->description_short}' with '{$product->description_short|substr:4:-5}' So fat it works ok and removes the 3 characters '<p>'. Info found on -http://www.prestashop.com/forums/topic/43107-solved-product-short-description-field-not-displaying-html/- ] Edited August 29, 2014 by zeisei (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted August 29, 2014 Share Posted August 29, 2014 it's not well solution you remove only first <p> and what about closing </p> tags? it can generate a lot of problems with theme design unclosed tags aren't good Link to comment Share on other sites More sharing options...
zeisei Posted August 31, 2014 Share Posted August 31, 2014 It removes also the end </p> tag BUT you are right that its a little bit dangerous and might mess up the code. Link to comment Share on other sites More sharing options...
Araviel Posted September 23, 2014 Share Posted September 23, 2014 take a look here: ADMIN_DIR/themes/default/template/controllers/products/helpers/form/form.tpl you have there tinymce objec SETUP definition: tinySetup({ editor_selector :"autoload_rte", change it to: tinySetup({ editor_selector :"autoload_rte", force_p_newlines : false, force_br_newlines : true, voila Hi, i'm searching exactly the same thing in Prestashop 1.6.0.6, but i'm unable to find it there is no more template and controllers folders in default theme, please help. thanks in advance ! Link to comment Share on other sites More sharing options...
Araviel Posted September 24, 2014 Share Posted September 24, 2014 Sorry I usually don't up topics but this time I really need help, still can't find it on prestashop 1.6.0.6, thanks in advance Link to comment Share on other sites More sharing options...
vekia Posted September 24, 2014 Share Posted September 24, 2014 Hi, i'm searching exactly the same thing in Prestashop 1.6.0.6, but i'm unable to find it there is no more template and controllers folders in default theme, please help. thanks in advance ! everything is described here: http://bit.ly/prestashop16-extend-tiny-mce Link to comment Share on other sites More sharing options...
vekia Posted September 24, 2014 Share Posted September 24, 2014 Sorry I usually don't up topics but this time I really need help, still can't find it on prestashop 1.6.0.6, thanks in advance don't worry, i totally understand :-) Link to comment Share on other sites More sharing options...
Araviel Posted September 24, 2014 Share Posted September 24, 2014 don't worry, i totally understand :-) thanks so with this modification i will able to put html without prestashop add things like <p> and /br automatically ? Link to comment Share on other sites More sharing options...
gazzza182 Posted February 23, 2016 Share Posted February 23, 2016 Sorry for dragging up an old thread, but i had the same problem, wanting to use the short description as the H1 tag on the product page. The problem is that the tinyMCE adds the P tag to the short description, which isn't w3c compatible. To stop this happening, I simply went to the following file: admin_folder\themes\default\template\controllers\products\informations.tpl At around line 335, there is the code: {include file="controllers/products/textarea_lang.tpl" languages=$languages input_name='description_short' class="autoload_rte" input_value=$product->description_short max=$PS_PRODUCT_SHORT_DESC_LIMIT} Simply remove the line class="autoload_rte", and it changes the field to a simple text box. I thought this might be useful for anyone having similar issues! 1 Link to comment Share on other sites More sharing options...
Anuragat Posted May 28, 2019 Share Posted May 28, 2019 This worked. Thank you. 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