An open API service indexing awesome lists of open source software.

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.

Awesome Lists containing this project

README

          

# Sulu block bundle

[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%208.1-green)](https://php.net/)
[![Minimum Sulu Version](https://img.shields.io/badge/sulu-%3E%3D%202.5-green)](https://symfony.com)
[![GitHub release](https://img.shields.io/github/v/release/Pixel-Open/sulu-blockbundle)](https://github.com/Pixel-Open/sulu-blockbundle/releases)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=Pixel-Open_sulu-blockbundle&metric=alert_status)](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

```