tobbecokta Posted October 10, 2012 Share Posted October 10, 2012 Hi, I would like to allow HTML in the blockreinsurance module. But i can't find where to change the code in blockreinsurance.php. Does anyone know? Br, Tobias Link to comment Share on other sites More sharing options...
vekia Posted October 10, 2012 Share Posted October 10, 2012 (edited) Hi, I would like to allow HTML in the blockreinsurance module. But i can't find where to change the code in blockreinsurance.php. Does anyone know? Br, Tobias you must edit template file not php file. Template files (.tpl) exists in module directory or are overrided in theme directory in this case you must edit blocreinsurance.tpl file Edited October 10, 2012 by vekia (see edit history) Link to comment Share on other sites More sharing options...
benjamin utterback Posted October 10, 2012 Share Posted October 10, 2012 hello tobbecokta, yes vekia is correct, the code is placed in the .tpl fiel for you to change. Please make sure you complete a working and confirmed back up before edited any of these files. Did you find the .tpl file you were looking to change? Link to comment Share on other sites More sharing options...
tobbecokta Posted October 13, 2012 Author Share Posted October 13, 2012 Hi, Yes i mean blockreinsurance.tpl. Heres the code; <!-- MODULE Block reinsurance --> <div id="reinsurance_block" class="clearfix" style="margin-top:46px;"><ul class="width{$nbblocks}">{foreach from=$infos item=info} <li><img src="{$module_dir}img/{$info.file_name}" alt="{$info.text|escape:html:'UTF-8'}" /> <span>{$info.text|escape:html:'UTF-8'}</span></li>{/foreach}</ul></div> <!-- /MODULE Block reinsurance --> {/if} But i can see how i can edit it.. Is it {$info.text|escape:html:'UTF-8'} i need to change? In that case i also have to change in admin so that the text field allow HTML-code to be saved.. Link to comment Share on other sites More sharing options...
tobbecokta Posted October 13, 2012 Author Share Posted October 13, 2012 Ok i think i solved it for the output in FO. I use the code {$info.text}. But when i try to add html to text in BO i get the following error message: An error occurred during the save. So i most likely need to change something in blockreinsurance.php. But i don't know what to change. Anyone? Link to comment Share on other sites More sharing options...
tobbecokta Posted October 15, 2012 Author Share Posted October 15, 2012 Hi again! Do you guys have any suggestion? Br, Tobias Link to comment Share on other sites More sharing options...
onico0 Posted May 7, 2013 Share Posted May 7, 2013 just change it in reinsuranceClass > 'text' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'required' => true), by > 'text' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isCleanHtml', 'required' => true), and it in blockreinsurance.tpl > {$info.text|escape:html:'UTF-8'} by > {$info.text} 1 Link to comment Share on other sites More sharing options...
vekia Posted May 7, 2013 Share Posted May 7, 2013 just change it in reinsuranceClass > 'text' =>array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'required' => true), by > 'text' =>array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isCleanHtml', 'required' => true), and it in blockreinsurance.tpl > {$info.text|escape:html:'UTF-8'} by > {$info.text} hello thanks for this know-how i checked it and it works fine regards Link to comment Share on other sites More sharing options...
huko Posted December 14, 2017 Share Posted December 14, 2017 I was looking for this solution but for Prestashop 1.7 and there is one small change necessary to make it work. in blockreinsurance.tpl > {$info.text|escape:html:'UTF-8'} for Prestashop 1.7 is like this: {$element.text nofilter} I hope it will help to someone :) 2 Link to comment Share on other sites More sharing options...
abe666 Posted August 1, 2018 Share Posted August 1, 2018 On 14. 12. 2017 at 7:36 AM, huko said: I was looking for this solution but for Prestashop 1.7 and there is one small change necessary to make it work. in blockreinsurance.tpl > {$info.text|escape:html:'UTF-8'} for Prestashop 1.7 is like this: {$element.text nofilter} I hope it will help to someone Yes, is usefull for me. Thanks Link to comment Share on other sites More sharing options...
Turtle Wet Sports Posted December 12, 2018 Share Posted December 12, 2018 On 12/14/2017 at 7:36 AM, huko said: I was looking for this solution but for Prestashop 1.7 and there is one small change necessary to make it work. in blockreinsurance.tpl > {$info.text|escape:html:'UTF-8'} for Prestashop 1.7 is like this: {$element.text nofilter} I hope it will help to someone :) Didn't work for me, PS 1.7.4 Or maybe I missed something, but when I put "blabla <br />blablbabla" the br is displayed... any suggestion ? Thanks ! Link to comment Share on other sites More sharing options...
jpg_es Posted December 18, 2018 Share Posted December 18, 2018 Didn't work for me, either. PS 1.7.4.3 If I put Envíos gratuitos a península a partir <a href="/content/6-envios-devoluciones"> 90 €</a> then <a href="/content/6-envios-devoluciones"> is showed in the page, it is not interpreted as html code. Any idea? Thanks Link to comment Share on other sites More sharing options...
jpg_es Posted December 18, 2018 Share Posted December 18, 2018 Good new, it works for me. I had "{$element.text}" then it didn't work, but with {$element.text nofilter} it works fine. How know I can overide reinsuranceClass? It doesn't work for me. 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