Browse Source

[Administration] Produit : champs 'description' en texte enrichi

develop
Guillaume Bourgeois 5 months ago
parent
commit
9ddfc98969
3 changed files with 8 additions and 4 deletions
  1. +6
    -1
      backend/views/product/_form.php
  2. +1
    -2
      producer/views/order/order.php
  3. +1
    -1
      producer/views/site/products.php

+ 6
- 1
backend/views/product/_form.php View File

@@ -56,7 +56,12 @@ $accessoryModule = $this->getAccessoryModule();
<?php endif; ?>
<?= $form->field($model, 'id_product_category')->dropDownList($productCategoryModule->populateProductCategoriesDropdownList()); ?>
<?= $form->field($model, 'description')->textInput(['maxlength' => 255]) ?>
<?= $form->field($model, 'recipe')->textarea()->label('Description longue') ?>
<?= $form->field($model, 'recipe')->label('Description longue')
->widget(letyii\tinymce\Tinymce::class, [
'configs' => [
'plugins' => Yii::$app->parameterBag->get('tinyMcePlugins')
],
]); ?>
<?= $form->field($model, 'unit')
->dropDownList(ArrayHelper::map(Product::$unitsArray, 'unit', 'wording'))
->label('Unité (pièce, poids ou volume)'); ?>

+ 1
- 2
producer/views/order/order.php View File

@@ -363,8 +363,7 @@ $this->setMeta('description', $producerModule->getSeoGenerator()->generateMetaDe
<div class="description-long" v-if="product.recipe.length">
<a href="javascript:void(0);" class="show-more-link">En savoir
plus</a>
<div class="content">
{{ product.recipe }}
<div class="content" v-html="product.recipe">
</div>
</div>
</td>

+ 1
- 1
producer/views/site/products.php View File

@@ -88,7 +88,7 @@ $this->setMeta('description', $producerModule->getSeoGenerator()->generateMetaDe
$html .= '<div class="description">' . Html::encode($model->description).'</div>';
}
if (strlen($model->recipe)) {
$html .= '<div class="description-long"><a href="javascript:void(0);" class="show-more-link">En savoir plus</a><div class="content">' . nl2br(Html::encode($model->recipe)).'</div></div>';
$html .= '<div class="description-long"><a href="javascript:void(0);" class="show-more-link">En savoir plus</a><div class="content">' . $model->recipe .'</div></div>';
}
return $html;
}

Loading…
Cancel
Save