Jump to content
thirty bees forum

Recommended Posts

Posted

how about adding the possibility to use HTML on blockcontactinfos?

it can be very useful for the "address" field to format it in a decent way or at least add a <br/> on it.

Posted

I found this: https://mypresta.eu/en/art/basic-tutorials/line-breaks-in-block-contact-informations-addon.html

and this: https://www.templatemonster.com/help/prestashop-1-6-x-allow-line-breaks-module-outputs.html

Posted

Hi,

Really easy, in fact, it's already a HTML block for the address field, the field is a texarea, and you can extend the field by draging the coner. When saving, an "HTML clean filter" remove HTML tag. When displaying, another filter transform HTML tag in clean characters.

To remove these filters, 2 modify to add:

  1. in modules\blockcontactinfos\blockcontactinfos.php, line 72, replace the getContent() function by : (just add "true" paramater to say it's some html you what to save) public function getContent() { $html = ''; if (Tools::isSubmit('submitModule')) { foreach (Blockcontactinfos::$contact_fields as $field) Configuration::updateValue($field, Tools::getValue($field), true); $this->_clearCache('blockcontactinfos.tpl'); $html = $this->displayConfirmation($this->l('Configuration updated')); } }
  2. in themes\community-theme-default\modules\blockcontactinfos\blockcontactinfos.tpl, remove HTML filter with that: {$blockcontactinfos_address nofilter}

If you need more texarea for other fiels, just replace the type field in renderForm() by: 'type' => 'textarea',

Should works, Regards.

Posted

Thank you @Lathaneo

Can I ask you why the fixes (linked above) I found weren't working?

I read this too: https://www.smarty.net/docsv2/en/language.modifier.nl2br.tpl

Posted

Hi, For the first one, he add nl2br filter, just transform the \n in
. Like he explained, it's should working, except if you add some HTML. In the case you add some HTML tags, you have to specify 'nofilter' for not transforning HTML Tags.

Second link, it's the same.

Regards.

Posted

I didn't add any HTML TAG, I simply write it the paragraph with new line but in the footer the new like was stripped out.

I still not used your solution, it didn't low down security enabling full HTML?

Posted

Hi,

It could be unsecure from trivial user, but like it's you who is writing the saved datas, it's ok. For example, don't remove HTML filter for datas from message boxes for the service after sale.

Regards.

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...