Skip to content

Commit 51dbfdb

Browse files
author
Maxime Leclercq
committed
doc: update template paths in readme and add upgrade guide
1 parent 1e6b8a6 commit 51dbfdb

File tree

2 files changed

+27
-13
lines changed

2 files changed

+27
-13
lines changed

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -242,13 +242,13 @@ monsieurbiz_sylius_richeditor:
242242
app.google_maps:
243243
title: 'app.ui_element.google_maps.title'
244244
description: 'app.ui_element.google_maps.description'
245-
icon: map pin
245+
icon: tabler:brand-google-maps
246246
classes:
247247
form: App\Form\Type\UiElement\GoogleMapsType
248248
#ui_element: App\UiElement\MyUiElement
249249
templates:
250-
admin_render: '/Admin/UiElement/google_maps.html.twig'
251-
front_render: '/Shop/UiElement/google_maps.html.twig'
250+
admin_render: '/admin/ui_element/google_maps.html.twig'
251+
front_render: '/shop/ui_element/google_maps.html.twig'
252252
tags: []
253253
```
254254

@@ -299,7 +299,7 @@ use MonsieurBiz\SyliusRichEditorPlugin\Attribute\AsUiElement;
299299
300300
#[AsUiElement(
301301
code: 'app.google_maps',
302-
icon: 'map pin',
302+
icon: 'tabler:brand-google-maps',
303303
)]
304304
class GoogleMapsType extends AbstractType
305305
// ...
@@ -309,8 +309,8 @@ The title, description and templates values are generated automatically from the
309309

310310
- the title will be `app.ui_element.google_maps.title`,
311311
- the description will be `app.ui_element.google_maps.description`,
312-
- the admin template will be `/Admin/UiElement/google_maps.html.twig`,
313-
- and the front template will be `/Shop/UiElement/google_maps.html.twig`.
312+
- the admin template will be `/admin/ui_element/google_maps.html.twig`,
313+
- and the front template will be `/shop/ui_element/google_maps.html.twig`.
314314

315315
But you can override them if you want:
316316

@@ -319,10 +319,10 @@ But you can override them if you want:
319319
code: 'app.google_maps',
320320
title: 'my_cusom.title', // Use your own translation key or a string
321321
description: 'my_custom.description',
322-
icon: 'map pin',
322+
icon: 'tabler:brand-google-maps',
323323
templates: new TemplatesUiElement(
324-
adminRender: 'MyCusomPath/google_maps.html.twig',
325-
frontRender: 'MyCusomPath/google_maps.html.twig',
324+
adminRender: 'admin/my_custom_path/google_maps.html.twig',
325+
frontRender: 'shop/my_custom_path/google_maps.html.twig',
326326
),
327327
uiElement: GoogleMapsUiElement::class, // Use your own UiElement class
328328
tags: ['map'], // Add some tags to filter the UiElement
@@ -396,21 +396,21 @@ It will be displayed in the admin form to help the user to understand what the U
396396
The file can be either:
397397
* An SVG with a `.twig` extension. Example: `button.svg.twig`.
398398
* A classic twig template. Example `button.html.twig`.
399-
You can add the files in the folder : `templates/MonsieurBizSyliusRichEditorPlugin/Wireframe/*.{svg/html}.twig`
399+
You can add the files in the folder : `templates/MonsieurBizSyliusRichEditorPlugin/wireframe/*.{svg/html}.twig`
400400
In the YAML declaration of a UI Element, you can add the wireframe key with the name of the file without the extension.
401401
```yaml
402402
monsieurbiz.title:
403403
alias: title
404404
title: 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.title.title'
405405
description: 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.title.description'
406-
icon: heading
406+
icon: tabler:heading
407407
wireframe: title
408408
tags: [ default ]
409409
classes:
410410
form: MonsieurBiz\SyliusRichEditorPlugin\Form\Type\UiElement\TitleType
411411
templates:
412-
admin_render: '@MonsieurBizSyliusRichEditorPlugin/Admin/UiElement/title.html.twig'
413-
front_render: '@MonsieurBizSyliusRichEditorPlugin/Shop/UiElement/title.html.twig'
412+
admin_render: '@MonsieurBizSyliusRichEditorPlugin/admin/ui_element/title.html.twig'
413+
front_render: '@MonsieurBizSyliusRichEditorPlugin/shop/ui_element/title.html.twig'
414414
```
415415

416416
## Wysiwyg Type

UPGRADE-3.1.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Upgrade from v3.0 to v3.1
2+
3+
- Template paths are replaced by snake case in the attribute and maker to match with the new naming convention in Sylius:
4+
- `Admin/UiElement/` is now `admin/ui_element/`
5+
- `Shop/UiElement/` is now `shop/ui_element/`
6+
- All template paths in the plugin are updated to match the new naming convention:
7+
- `Admin/` is now `admin/`
8+
- `Admin/UiElement/` is now `admin/ui_element/`
9+
- `Admin/formContainer.html.twig` is now `admin/form_container.html.twig`
10+
- `Form/` is now `form/`
11+
- `Icon/Ux` is now `icon/ux/`
12+
- `Shop/` is now `shop/`
13+
- `Shop/UiElement/` is now `shop/ui_element/`
14+
- `Wireframe/` is now `wireframe/`

0 commit comments

Comments
 (0)