Version

Documentation » Block

4. Your first block »

« 2. Twig Helpers

3. Provided Blocks

Some block services are already provided. You may use them or check out the code to get ideas on how to create your own. You can also check this documentation: Your first block.

3.1. EmptyBlockService

The purpose of this block is to always return content, even on exceptions (Sonata\BlockBundle\Exception\BlockNotFoundException). See Advanced Usage.

3.2. TextBlockService

This block allows you to render anything you’d like. Be warned, the content you feed it with will be directly interpreted (which allows you to put in some HTML for instance).

Pretty straightforward, you need only to add the block service to your page and configure it with the content you’d like to see displayed in HTML.

3.3. RssBlockService

This block displays an RSS feed.

When you add this block, specify a title and an RSS URL. Then, the last messages from the RSS feed will be displayed in your block.

Base template is @SonataBlock/Block/block_core_rss.html.twig but you may of course override it.

Found a typo? Something is wrong in this documentation? Just fork and edit it!