Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
Commit 246277f2 authored by Nicolas BEJEAN's avatar Nicolas BEJEAN
Browse files

Mise à jour du fichier Readme

parent ef0f577d
No related branches found
No related tags found
No related merge requests found
...@@ -8,6 +8,8 @@ Permet d'afficher une catégorie ou une liste de catégories avec leur image. ...@@ -8,6 +8,8 @@ Permet d'afficher une catégorie ou une liste de catégories avec leur image.
- widget_title (setWidgetTitle) : Optionnel : Titre H2 du widget - widget_title (setWidgetTitle) : Optionnel : Titre H2 du widget
- widget_content (setWidgetContent) : Optionnel : Contenu texte servant à insérer une description dans le widget - widget_content (setWidgetContent) : Optionnel : Contenu texte servant à insérer une description dans le widget
- category_selection (setCategorySelection): Obligatoire : ID de la catégorie à afficher. Pour en afficher plusieurs 3,6 - category_selection (setCategorySelection): Obligatoire : ID de la catégorie à afficher. Pour en afficher plusieurs 3,6
- category_image_width (setCategoryImageWidth) : Optionnel : Définit la largeur en pixels pour la compression de l'image, par défaut 300px
- category_image_height (setCategoryImageHeight) : Optionnel : Définit la hateur en pixels pour la compression de l'image, par défaut 300px
- template (setTemplate) : Obligatoire : Permet de sélectionner le template de rendu - template (setTemplate) : Obligatoire : Permet de sélectionner le template de rendu
## Exemples d'intégration ## Exemples d'intégration
...@@ -16,7 +18,9 @@ Dans un fichier layout (XML) : ...@@ -16,7 +18,9 @@ Dans un fichier layout (XML) :
```xml ```xml
<block class="NicolasBejean\CategoryWidget\Block\Widget\CategoryWidget"> <block class="NicolasBejean\CategoryWidget\Block\Widget\CategoryWidget">
<arguments> <arguments>
<argument name="category_selection" xsi:type="string">3</argument> <argument name="category_selection" xsi:type="string">4,5,6,7</argument>
<argument name="category_image_width" xsi:type="string">450</argument>
<argument name="category_image_height" xsi:type="string">450</argument>
<argument name="template" xsi:type="string">widget/category_widget_img_background.phtml</argument> <argument name="template" xsi:type="string">widget/category_widget_img_background.phtml</argument>
</arguments> </arguments>
</block> </block>
...@@ -27,32 +31,18 @@ Dans un fichier de template (PHTML) : ...@@ -27,32 +31,18 @@ Dans un fichier de template (PHTML) :
<?php <?php
echo $this ->getLayout() echo $this ->getLayout()
->createBlock("NicolasBejean\CategoryWidget\Block\Widget\CategoryWidget") ->createBlock("NicolasBejean\CategoryWidget\Block\Widget\CategoryWidget")
->setCategorySelection("6") ->setCategorySelection("4,5,6,7")
->setTemplate("widget/category_widget.phtml") ->setCategoryImageWidth("450")
->setCategoryImageHeight("450")
->setTemplate("widget/category_widget_img_background.phtml")
->toHtml(); ->toHtml();
?> ?>
``` ```
Dans le backoffice : Dans le backoffice :
```html ```html
{{widget type="NicolasBejean\CategoryWidget\Block\Widget\CategoryWidget" widget_title="titre" widget_content="tag" category_selection="3" template="widget/category_widget_img_background.phtml"}} {{widget type="NicolasBejean\CategoryWidget\Block\Widget\CategoryWidget" widget_title="titre" widget_content="tag" category_selection="3" category_image_width="450" category_image_height="450" template="widget/category_widget_img_background.phtml"}}
```
## Structure LESS
Le fichier LESS doit être créé dans le dossier Category_Widget/web/css/source/_categoryWidget
```less
.category-widget {
.content-heading {
h2.title {}
p.content {}
}
.categories {
a.category {
img {}
span {}
}
}
}
``` ```
## Source ## Source
https://github.com/Programmingatkstark/Magento-2-Category-with-image-widget https://github.com/Programmingatkstark/Magento-2-Category-with-image-widget
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment