Jump to content

prestashop 1.6 : carriage return in features


Recommended Posts

hi,

i work on firefox with prestashop 1.6, and i would like to  display multiple lines for one feature, like this :  

  Capture2.PNG.543e0bc16c26f11f1a20e3f3b12ad3fc.PNG

 

I overrided the file AdminFeaturesController.php, in the function initFormFeatureValue I replaced

array(
    'type' => 'text',
    'label' => $this->l('Value'),
    'name' => 'value',
    'lang' => true,
    'size' => 33,
    'hint' => $this->l('Invalid characters:').' <>;=#{}',
    'required' => true
),

with

array(
    'type' => 'textarea',
    'label' => $this->l('Value'),
    'name' => 'value',
    'lang' => true,
    'hint' => $this->l('Invalid characters:').' <>;=#{}',
    'required' => true
),

 

Then I modified the front office template file themes/default/product.tpl, adding nl2br function like this :

{$feature.value|nl2br|escape:'html':'UTF-8'}

 

but now the FO displays the <br /> tag without interpreting them

5ba2429d2a188_Capturedu2018-09-1910-30-10.thumb.png.3f8ad16597711b14ad088fad56982561.png

 

does anyone know how to make the page interprete those tags or why it reacted like this ?

 

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