Page Title Move for All Pages - Magento2
-
23-03-2021 - |
Question
<div class="columns">
<div class="column main">
<div class="page-title-wrapper">
<h1 class="page-title">
<span class="base" data-ui-id="page-title-wrapper">My Account</span>
</h1>
</div>
</div>
</div>
How can i move page-title-wrapper
div between columns
and column main
?
I have try this one by one but not working:
<move element="page.main.title" destination="content" after="columns"/>
<move element="category.image" destination="page.title.wrapper" after="page.main.title" />
<move element="page.main.title" destination="headerlinks" after="columns" />
<move element="page.title.wrapper" destination="header.panel" before="-"/>
<move element="page.main.title" destination="headerlinks" before="-"/>
Any help will be appreciated.... Thanks in advanced.
Solution
If you want to add page.main.title
block inside column main
then use below line
<move element="page.main.title" destination="main" before="-" />
Or if you want to move that inside columns
then use below line
<move element="page.main.title" destination="columns" before="-" />
UPDATE :
default.xml
file content
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<move element="page.main.title" destination="columns" before="-" />
</body>
</page>
If you want to add title inside column
tag in My Account page then please create this file (customer_account_index.xml
) inside your theme/module
app/code/Vendor/Module/view/frontend/layout/customer_account_index.xml
Content for this file is..
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<move element="page.main.title" destination="columns" before="-" />
</body>
</page>
Output :
Hope this will help you!
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange