Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,35 @@ monsieurbiz_sylius_richeditor:
enabled: false
```

#### Disable UI Elements via environment variables

Each UI Element can be enabled or disabled using environment variables. This is useful for managing UI Elements across different environments without modifying configuration files.

```yaml
# Example: Disable the YouTube element via environment variable
MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_YOUTUBE_ENABLED=false
```

Available environment variables:
- `MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_HTML_ENABLED` (default: true)
- `MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_TEXT_ENABLED` (default: true)
- `MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_QUOTE_ENABLED` (default: true)
- `MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_IMAGE_ENABLED` (default: true)
- `MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_VIDEO_ENABLED` (default: true)
- `MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_BUTTON_ENABLED` (default: true)
- `MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_TITLE_ENABLED` (default: true)
- `MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_H1_ENABLED` (default: false)
- `MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_H2_ENABLED` (default: false)
- `MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_H3_ENABLED` (default: false)
- `MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_SEPARATOR_ENABLED` (default: true)
- `MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_ANCHOR_ENABLED` (default: true)
- `MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_YOUTUBE_ENABLED` (default: true)
- `MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_IMAGE_COLLECTION_ENABLED` (default: true)
- `MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_TWO_COLUMNS_ENABLED` (default: true)
- `MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_COLUMN_ENABLED` (default: true)
- `MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_ROW_ENABLED` (default: true)
- `MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_MARKDOWN_ENABLED` (default: true)

## Available elements

- Two columns element (Layout)
Expand Down
18 changes: 18 additions & 0 deletions src/Resources/config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,24 @@ parameters:
env(MONSIEURBIZ_SYLIUS_RICH_EDITOR_IMAGE_UPLOAD_DIR): /media/image
env(MONSIEURBIZ_SYLIUS_RICH_EDITOR_ENABLED_HIGHLIGHT_JS_SHOP): 'false'
env(MONSIEURBIZ_SYLIUS_RICH_EDITOR_ENABLED_HIGHLIGHT_JS_THEME): 'default'
env(MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_HTML_ENABLED): 'true'
env(MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_TEXT_ENABLED): 'true'
env(MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_QUOTE_ENABLED): 'true'
env(MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_IMAGE_ENABLED): 'true'
env(MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_VIDEO_ENABLED): 'true'
env(MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_BUTTON_ENABLED): 'true'
env(MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_TITLE_ENABLED): 'true'
env(MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_H1_ENABLED): 'false'
env(MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_H2_ENABLED): 'false'
env(MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_H3_ENABLED): 'false'
env(MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_SEPARATOR_ENABLED): 'true'
env(MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_ANCHOR_ENABLED): 'true'
env(MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_YOUTUBE_ENABLED): 'true'
env(MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_IMAGE_COLLECTION_ENABLED): 'true'
env(MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_TWO_COLUMNS_ENABLED): 'true'
env(MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_COLUMN_ENABLED): 'true'
env(MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_ROW_ENABLED): 'true'
env(MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_MARKDOWN_ENABLED): 'true'

twig:
globals:
Expand Down
21 changes: 18 additions & 3 deletions src/Resources/config/richeditor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ monsieurbiz_sylius_richeditor:
templates:
admin_render: '@MonsieurBizSyliusRichEditorPlugin/admin/ui_element/html.html.twig'
front_render: '@MonsieurBizSyliusRichEditorPlugin/shop/ui_element/html.html.twig'
enabled: '%env(bool:MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_HTML_ENABLED)%'
monsieurbiz.text:
alias: text
title: 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.text.title'
Expand All @@ -26,6 +27,7 @@ monsieurbiz_sylius_richeditor:
templates:
admin_render: '@MonsieurBizSyliusRichEditorPlugin/admin/ui_element/text.html.twig'
front_render: '@MonsieurBizSyliusRichEditorPlugin/shop/ui_element/text.html.twig'
enabled: '%env(bool:MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_TEXT_ENABLED)%'
monsieurbiz.quote:
alias: quote
title: 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.quote.title'
Expand All @@ -38,6 +40,7 @@ monsieurbiz_sylius_richeditor:
templates:
admin_render: '@MonsieurBizSyliusRichEditorPlugin/admin/ui_element/quote.html.twig'
front_render: '@MonsieurBizSyliusRichEditorPlugin/shop/ui_element/quote.html.twig'
enabled: '%env(bool:MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_QUOTE_ENABLED)%'
monsieurbiz.image:
alias: image
title: 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.image.title'
Expand All @@ -50,6 +53,7 @@ monsieurbiz_sylius_richeditor:
templates:
admin_render: '@MonsieurBizSyliusRichEditorPlugin/admin/ui_element/image.html.twig'
front_render: '@MonsieurBizSyliusRichEditorPlugin/shop/ui_element/image.html.twig'
enabled: '%env(bool:MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_IMAGE_ENABLED)%'
monsieurbiz.video:
alias: video
title: 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.video.title'
Expand All @@ -62,6 +66,7 @@ monsieurbiz_sylius_richeditor:
templates:
admin_render: '@MonsieurBizSyliusRichEditorPlugin/admin/ui_element/video.html.twig'
front_render: '@MonsieurBizSyliusRichEditorPlugin/shop/ui_element/video.html.twig'
enabled: '%env(bool:MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_VIDEO_ENABLED)%'
monsieurbiz.button:
alias: button
title: 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.button.title'
Expand All @@ -74,6 +79,7 @@ monsieurbiz_sylius_richeditor:
templates:
admin_render: '@MonsieurBizSyliusRichEditorPlugin/admin/ui_element/button.html.twig'
front_render: '@MonsieurBizSyliusRichEditorPlugin/shop/ui_element/button.html.twig'
enabled: '%env(bool:MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_BUTTON_ENABLED)%'
monsieurbiz.title:
alias: title
title: 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.title.title'
Expand All @@ -86,6 +92,7 @@ monsieurbiz_sylius_richeditor:
templates:
admin_render: '@MonsieurBizSyliusRichEditorPlugin/admin/ui_element/title.html.twig'
front_render: '@MonsieurBizSyliusRichEditorPlugin/shop/ui_element/title.html.twig'
enabled: '%env(bool:MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_TITLE_ENABLED)%'
monsieurbiz.h1:
title: 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.h1.title'
description: 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.h1.description'
Expand All @@ -97,7 +104,7 @@ monsieurbiz_sylius_richeditor:
templates:
admin_render: '@MonsieurBizSyliusRichEditorPlugin/admin/ui_element/h1.html.twig'
front_render: '@MonsieurBizSyliusRichEditorPlugin/shop/ui_element/h1.html.twig'
enabled: false
enabled: '%env(bool:MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_H1_ENABLED)%'
monsieurbiz.h2:
title: 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.h2.title'
description: 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.h2.description'
Expand All @@ -109,7 +116,7 @@ monsieurbiz_sylius_richeditor:
templates:
admin_render: '@MonsieurBizSyliusRichEditorPlugin/admin/ui_element/h2.html.twig'
front_render: '@MonsieurBizSyliusRichEditorPlugin/shop/ui_element/h2.html.twig'
enabled: false
enabled: '%env(bool:MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_H2_ENABLED)%'
monsieurbiz.h3:
title: 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.h3.title'
description: 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.h3.description'
Expand All @@ -121,7 +128,7 @@ monsieurbiz_sylius_richeditor:
templates:
admin_render: '@MonsieurBizSyliusRichEditorPlugin/admin/ui_element/h3.html.twig'
front_render: '@MonsieurBizSyliusRichEditorPlugin/shop/ui_element/h3.html.twig'
enabled: false
enabled: '%env(bool:MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_H3_ENABLED)%'
monsieurbiz.separator:
alias: separator
title: 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.separator.title'
Expand All @@ -134,6 +141,7 @@ monsieurbiz_sylius_richeditor:
templates:
admin_render: '@MonsieurBizSyliusRichEditorPlugin/admin/ui_element/separator.html.twig'
front_render: '@MonsieurBizSyliusRichEditorPlugin/shop/ui_element/separator.html.twig'
enabled: '%env(bool:MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_SEPARATOR_ENABLED)%'
monsieurbiz.anchor:
alias: anchor
title: 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.anchor.title'
Expand All @@ -146,6 +154,7 @@ monsieurbiz_sylius_richeditor:
admin_render: '@MonsieurBizSyliusRichEditorPlugin/admin/ui_element/anchor.html.twig'
front_render: '@MonsieurBizSyliusRichEditorPlugin/shop/ui_element/anchor.html.twig'
tags: [default, anchor]
enabled: '%env(bool:MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_ANCHOR_ENABLED)%'
monsieurbiz.youtube:
alias: youtube
title: 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.youtube.title'
Expand All @@ -158,6 +167,7 @@ monsieurbiz_sylius_richeditor:
templates:
admin_render: '@MonsieurBizSyliusRichEditorPlugin/admin/ui_element/youtube.html.twig'
front_render: '@MonsieurBizSyliusRichEditorPlugin/shop/ui_element/youtube.html.twig'
enabled: '%env(bool:MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_YOUTUBE_ENABLED)%'
monsieurbiz.image_collection:
alias: image_collection
title: 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.image_collection.title'
Expand All @@ -170,6 +180,7 @@ monsieurbiz_sylius_richeditor:
templates:
admin_render: '@MonsieurBizSyliusRichEditorPlugin/admin/ui_element/image_collection.html.twig'
front_render: '@MonsieurBizSyliusRichEditorPlugin/shop/ui_element/image_collection.html.twig'
enabled: '%env(bool:MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_IMAGE_COLLECTION_ENABLED)%'
monsieurbiz.two_columns:
alias: two_columns
title: 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.two_columns.title'
Expand All @@ -182,6 +193,7 @@ monsieurbiz_sylius_richeditor:
templates:
admin_render: '@MonsieurBizSyliusRichEditorPlugin/admin/ui_element/two_columns.html.twig'
front_render: '@MonsieurBizSyliusRichEditorPlugin/shop/ui_element/two_columns.html.twig'
enabled: '%env(bool:MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_TWO_COLUMNS_ENABLED)%'
monsieurbiz.column:
alias: column
title: 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.column.title'
Expand All @@ -194,6 +206,7 @@ monsieurbiz_sylius_richeditor:
templates:
admin_render: '@MonsieurBizSyliusRichEditorPlugin/admin/ui_element/column.html.twig'
front_render: '@MonsieurBizSyliusRichEditorPlugin/shop/ui_element/column.html.twig'
enabled: '%env(bool:MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_COLUMN_ENABLED)%'
monsieurbiz.row:
alias: row
title: 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.row.title'
Expand All @@ -206,6 +219,7 @@ monsieurbiz_sylius_richeditor:
templates:
admin_render: '@MonsieurBizSyliusRichEditorPlugin/admin/ui_element/row.html.twig'
front_render: '@MonsieurBizSyliusRichEditorPlugin/shop/ui_element/row.html.twig'
enabled: '%env(bool:MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_ROW_ENABLED)%'
monsieurbiz.markdown:
alias: markdown
title: 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.markdown.title'
Expand All @@ -218,3 +232,4 @@ monsieurbiz_sylius_richeditor:
templates:
admin_render: '@MonsieurBizSyliusRichEditorPlugin/admin/ui_element/markdown.html.twig'
front_render: '@MonsieurBizSyliusRichEditorPlugin/shop/ui_element/markdown.html.twig'
enabled: '%env(bool:MONSIEURBIZ_SYLIUS_RICH_EDITOR_UI_ELEMENT_MARKDOWN_ENABLED)%'
Loading