Inside views folder you will find folder layouts contain 2 floders of theme for example if you go to vendor/oro/commerce/src/Oro/Bundle/CMSBundle/Resources/views/layouts , you will find 2 themes blank and default as basic theme .
Inside everyone of it we have folders which named by (oro_frontend_root = home page or global declaration) (oro_cms_frontend_page_view = cms page view ) .
inisde this last folders you have your layouts yml with .twig is the renderer of .yml layout . Ok let's open vendor/oro/commerce/src/Oro/Bundle/CMSBundle/Resources/views/layouts/default/oro_frontend_root/home_page_slider.yml the content is :
layout: actions: - '@setBlockTheme': themes: 'default.html.twig' - '@addTree': items: hero_promo_container: blockType: container prepend: true hero_promo: blockType: content_block options: alias: home-page-slider tree: page_content: hero_promo_container: hero_promo: ~
By word actions you start push your content , here we have two actions : @setBlockTheme for set the .twig renderer of this layout default.html.twig . And the @addTree of container and content block . The container :
hero_promo_container: blockType: container prepend: true
and the block :
blockType: content_block options: alias: home-page-slider
alias here is the name of cms page , is already created from admin with this code .
In last you have the structure of tree :
page_content: hero_promo_container: hero_promo: ~
contentBlock.content : will use the alias home-page-slider the get block instance and display content
oro_html_tag_trim(['script','style', 'link']) : you have allowed script style and link tag (execution and rendering)
The **OroLayoutBundle** introduces a set of block types that allow to easily build HTML layout structure.
| Type name | Default HTML output |
|-----------|-------------|
| `root` | `<html>` |
| `head` | `<head>` |
| `title` | `<title>` |
| `meta` | `<meta>` |
| `style` | `<style>` with content or `<link>` with external resource |
| `script` | `<script>` |
| `external_resource` | `<link>` |
| `body` | `<body>` |
| `form_start` | `<form>` |
| `form_end` | `</form>` |
| `form` | Creates three child block: `form_start`, `form_fields`, `form_end` |
| `form_fields` | Adds form fields based on the Symfony form |
| `form_field` | Block will be rendered differently depending on the field type of the Symfony form |
| `fieldset` | `<fieldset>` |
| `link` | `<a>` |
| `list` | `<ul>` |
| `ordered_list` | `<ol>` |
| `list_item` | `<li>`, this block type can be used if you want to control rendering of `li` tag and its attributes |
| `text` | Text node |
| `input` | Input node |
| `button` | `<button>` or `<input type="submit/reset/button">` |
| `button_group` | Nothing, this is just a logical grouping of buttons. You can define how to render the button group in your application |
Comments