- Magento Development
- Magento Services
- Industry Solutions
- Hire Magento Developer
Today we are going to see how to move elements in Magento 2.
Magento 2 is famous for releasing new functionality, features and approaches. We are going to talk about the new feature of templating.
Magento 2 offers this functionality where we can move blocks or let’s say containers to different places and that too within the page. With the help of the layout file, we can move containers & blocks.
Let’s see how to move elements in Magento 2
We can use this tiny piece of code in layout file to move containers & blocks.
<move element="name of conatiner or block" destination="destination block or container name" />
Let’s see the example. Here we are going to move price block directly at product page.
Below code will do the magic.
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<move element="product.info.price" destination="product.info.media" />
VOILA!! You see. That’s how a tiny piece of code will help us to move elements in Magento 2.
create the event.xml on your module under the Vendor/Module/etc/event.xml and...
If you need a custom meta tag for a specific...
Generally, if you load font as preload, it will load...
Step 1: First you need to add di.xml in the...
Override the vendor/magento/module-sales/view/frontend/templates/email/items/order/default.phtml file on your theme and add the...