https://github.com/pixel-open/sulu-blockbundle
A bundle that allows to manage content block for the SULU CMS.
https://github.com/pixel-open/sulu-blockbundle
sulu-bundle
Last synced: 4 months ago
JSON representation
A bundle that allows to manage content block for the SULU CMS.
- Host: GitHub
- URL: https://github.com/pixel-open/sulu-blockbundle
- Owner: Pixel-Open
- Created: 2023-02-10T14:50:15.000Z (over 3 years ago)
- Default Branch: develop
- Last Pushed: 2024-12-05T14:59:08.000Z (over 1 year ago)
- Last Synced: 2025-02-24T01:18:11.795Z (over 1 year ago)
- Topics: sulu-bundle
- Language: Twig
- Homepage:
- Size: 143 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- Changelog: changelog.md
Awesome Lists containing this project
README
# Sulu block bundle
[](https://php.net/)
[](https://symfony.com)
[](https://github.com/Pixel-Open/sulu-blockbundle/releases)
[](https://sonarcloud.io/summary/new_code?id=Pixel-Open_sulu-blockbundle)
A bundle that allows to manage content block for the SULU CMS.
It is a fork from the https://github.com/Harborn-digital/sulu-block-bundle project.
## 1. Installation
### Composer
```bash
composer require pixelopen/sulu-block-bundle
```
## 2. Usage
### Template
Page template modification (mind to include this element: xmlns:xi="http://www.w3.org/2001/XInclude")
```xml
default
templates/default
SuluWebsiteBundle:Default:index
2400
Default
Standaard
Content
Inhoud
Banners
```
### Twig
Add blocks to the Twig
```twig
{% block content %}
{{ content.title }}
{{ content.article|raw }}
{% include '@Block/html5-blocks.html.twig' %}
{% include '@Block/html5-blocks.html.twig' with {element: 'aside', collection: 'banners'} %}
{% endblock %}
```
#### Override Twig templates
Create the following structure to override blocks via Twig `templates/bundles/PixelBlockBundle`.
If you wish to override the following block `Resources/views/html5/parts/images.html.twig`, you must create the next file : `templates/bundles/PixelBlockBundle/html5/parts/images.html.twig`.
And if you only want to replace some of the template blocks in this bundle, you can extend the base template using this namespace `@!Block`.
For example
```twig
{# templates/bundles/PixelBlockBundle/html5/parts/images.html.twig #}
{% extends "@!Block/html5/parts/images.html.twig" %}
{% block image_source %}{{ image.thumbnails['50x50'] }}{% endblock %}
```
## 3. Available blocks
- Rich text with a title (text)
- Images with a title (images)
- Images with a title and a rich text (image_text)
- Image, title with sub-title and quote (image_title_subtitle_quote)
- Youtube video (youtube)
- Link (link)
- Quote (quote)
- Before/After (image_before_after)
- Twi columns (two_columns)
- Three columns (three_columns)
## 4. Add properties
When you use a block and you want to add additional properties, you can configure them separately in `config/templates/PixelSuluBlockBundle/properties/{blockname}.xml`.
For instance, if you wish to add a caption to the images block, you will create the following fil in you customer application:
```xml
Caption
```
## 5. Override properties parameters
### 5.1 Completely replace all parameters
When you use a block and you want to choose youself all the parameters to the blocks properties, you can configure them separately in `config/templates/PixelSuluBlockBundle/params/{blockname}.xml`.
For example, if you want to define all the text editor property parameters, you will create the following file in you customer application:
```xml
```
### 5.2 Adjust parameters
When you use a block and you wish to edit parameters to the blocks properties, you can configure them in `config/templates/PixelSuluBlockBundle/params/{blockname}_adjustments.xml`.
For instance, if you want to adjust the height and deactivate the tab feature of the text editor property, you will create the following file in your customer application:
```xml
```
### 5.3 Add parameters
When you use a block and you want to add parameters to the blocks properties, you can separately configure them in `config/templates/PixelSuluBlockBundle/params/{blockname}_additions.xml`.
For instance, if you wish to add the ui_color parameter to the text_editor property, you will create the following file in your customer application:
```xml
```