Jump to content

Allow HTML in block reinsurance


tobbecokta

Recommended Posts

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 by vekia (see edit history)
Link to comment
Share on other sites

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

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

  • 6 months later...

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}

  • Like 1
Link to comment
Share on other sites

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

  • 4 years later...

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 :)

 

  • Like 2
Link to comment
Share on other sites

  • 7 months later...
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

  • 4 months later...
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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...