Beeta Posted January 25, 2018 Posted January 25, 2018 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.
Beeta Posted January 26, 2018 Author Posted January 26, 2018 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
Beeta Posted January 26, 2018 Author Posted January 26, 2018 I tried the second solution without success, in first one the code a little different from the TB one.
Lathaneo Posted January 26, 2018 Posted January 26, 2018 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: 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')); } } 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.
Beeta Posted January 26, 2018 Author Posted January 26, 2018 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
Lathaneo Posted January 26, 2018 Posted January 26, 2018 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.
Beeta Posted January 29, 2018 Author Posted January 29, 2018 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?
Lathaneo Posted January 29, 2018 Posted January 29, 2018 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.
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