pablocattaneo
6/6/2017 - 12:41 PM

Move a blocks or containers. Move elements inside a container (no a block). If we wish move a block or container in a place that there is n

Move a blocks or containers.

Move elements inside a container (no a block). If we wish move a block or container in a place that there is no container we can create a new one and positionate it using attribute after or before


<move element="move.block.to.move" destination="name.of.the.container" before="-"/>

<!-- Example: This move the element page.messages inside the content container at the beginning of ir (before="-") -->
<move element="page.messages" destination="content" before="-"/>

<!-- Move elements inside a container (no a block). If we wish move a block or container in a place that there is no container we can create a new one and positionate it using attribute after or before -->
<!-- Create the container agotado -->
...
  <container name="alert.urls" as="alert_urls" label="Alert Urls" after="product.price.tier"/>
  <container name="agotado" as="agotado" before="product.info.form.content"/>
  <block class="Magento\Catalog\Block\Product\View" name="product.info" template="product/view/form.phtml" after="alert.urls">
      <container name="product.info.form.content" as="product_info_form_content">
          <block class="Magento\Catalog\Block\Product\View" name="product.info.addtocart" as="addtocart" template="product/view/addtocart.phtml"/>
      </container> 
...

<move element="product.info.stock.sku" destination="agotado" before="-"/>