Questions tagged [page-layouts]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
14
votes
2answers
32k views

Adding custom layouts for CMS and Category use with custom module trouble

I have a category in my store that requires a totally different layout to the standard Magento layouts. So I created a new copy of the 1column.phtml and renamed it and made one small change to test. ...
13
votes
2answers
11k views

CMS XML Handles for Layout Updates

I've had a few scenarios where I've tried to use the cms handles to update a cms page's layout. For example I was trying to use the cms_index_index handle referencing root and setting the page ...
12
votes
3answers
17k views

How to render HTML with AJAX in Magento 2

I try to find the best way to render HTML through AJAX in Magento 2. Way 1 : Using Controller without layout File Foo/Bar/Controller/Popin/Content.php <?php namespace Foo\Bar\Controller\...
11
votes
3answers
17k views

Add new page layout option Magento

I'd like to add a new page layout in Magento that will be an option that can be selected in CMS pages. I have copied the 1-column.phtml code and adapted it slightly and changed it to 1-column-version2....
11
votes
2answers
1k views

How can I add a page layout to Mage_Page module?

I discovered after upgrading Magento that the core Mage_Page's config.xml had been manually edited, and now I'm looking to change the XML in a way that doesn't overwrite core. Here is an example of ...
10
votes
1answer
15k views

How to remove reference container block from layout?

I want to remove the block from referenceContainer. I have gone through the below link: Remove block from layout in Magento 2 And tried to remove as per the above answer: <referenceBlock name="...
9
votes
3answers
10k views

Is it possible to remove elements in a page layout in Magento2?

When I read the documentation on page-layouts (http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/layouts/layout-types.html#layout-types-page) I see that the following instructions in this XML ...
9
votes
1answer
1k views

What is the use of page_types.xml at magento2

I am seen that some of magento modules has page_types.xml at configuration section means ../etc/frontend section. <page_types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
8
votes
6answers
7k views

Title tag in layout is not translated

I don't know if this a bug, but title tag in layout is not translated. For example, <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="...
6
votes
1answer
159 views

How does an extension display info and warning messages in a theme-agnostic way?

Not looking to display form validation errors, but more global messages like "Hurry quick -- offer ends in 4 hours" or "Currently there are 3 users online". The question is not about how to generate ...
5
votes
4answers
3k views

Magento 2 : Alternate Logo for Page Layout

I'm developing Magento 2.1 application with two logos: Light logo on the home page. Dark logo for all other pages. By default, theme uses dark logo. I've created a custom page layout for home page. ...
5
votes
0answers
1k views

Magento 2.2 sidebar and additional sidebar issue

My Magento installation behaves weird. Sidebar main and sidebar additional do not display on the same level as column main as it should but Magento layout engine moves them under the column main. I ...
5
votes
3answers
2k views

Show product of a category in a custom page

I create a category with some product. Also create a custom layout for my page that I add new cms page with this layout that I created. I need to have this page with my layout because I want to add ...
4
votes
2answers
12k views

Magento 2 add new custom container above <main> tag

I want to add new custom container the <main> tag. I have created the custom layout for my custom page design. I have created in the below directory: app\design\frontend\Vendor\Theme\...
4
votes
1answer
4k views

Remove Css and js from new custom page_layout from header and body Magento 2

I have created a new Design Layout (named "blank") for select in page creation in my theme i have these created. design/frontend/Vendor/Theme/Magento_Theme/layouts.xml <?xml version="1.0" ...
4
votes
1answer
2k views

Magento 2 Blank Layout Page

I tried to create a new tab in customer edit backend. First i create the app/code/Namespace/Point/view/adminhtml/layout/customer_index_edit.xml <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-...
4
votes
1answer
268 views

Magento 2: How to create custom layout instructions to match a custom product page layout?

I am trying to work on a product subscriptions page which is very different in function from a standard product page. I have created my new Magento_Theme/page_layout/subscription.xml I set Magento 2 ...
3
votes
4answers
13k views

Add .phtml file on all pages magento 2

I want to add my custom.phtml file on the top of all pages. How can I do this using custom module ? Any suggestion would be appreciated. Thanks
3
votes
1answer
830 views

Page Title Move for All Pages - Magento2

<div class="columns"> <div class="column main"> <div class="page-title-wrapper"> <h1 class="page-title"> <span class="base" data-ui-id="page-title-...
3
votes
3answers
2k views

How to make <head><title>…</title><head> translatable in layout definition

Here I have the default contact page layout file (contact_index_index.xml): <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:...
3
votes
3answers
1k views

How to remove container from homepage only

I added div(container) in every page except homepage like this <main> <div class="myclass"> all content here </div> </main> I tried ...
3
votes
1answer
5k views

Magento2 : Get Current Page layout

I have Added Custom page layout in my store.And set Test Category Page But when I try to get my phtml file in category page $request = $objectManager->get('Magento\Framework\App\Request\Http'); $...
3
votes
1answer
1k views

Is there a better way to add layout updates to a category rather than using the “Custom Layout Updates” field?

Here's the issue in a nutshell; I have a module adding custom templates that can be used for CMS Pages or Categories. The layout I'm using has updates in local.xml referencing the layout_handle ...
3
votes
0answers
3k views

Magento 2 - How to open login & Sign up form in POPUP window [closed]

I required to display login / Signup in popup window. Have created the login module as per this link Extension installed successfully but onclick of Login/signup button no action is performed. ...
3
votes
1answer
566 views

Product image disappears on product page when using a custom page layout

I'm creating a custom theme on Magento 2.1. I create a custom layout for the product page in app/design/frontend/<theme_name>/base/Magento_Catalog/layout/catalog_product_view.xml, here it is: &...
2
votes
1answer
850 views

Magento 2 Add css class to <a> tag in customer account navigation

I try to assign a CSS class to navigation ( tag) under customer account page. I found this file customer_account.xml, and I added <argument name="css_class" xsi:...
2
votes
1answer
2k views

How to add layered navigation in Magento 2 on Top After Menu

I tried to move layered navigation from left-side to top of the products.But Nothing displays When I changed the page layout from 2 column layout to 1 column layout then it shows only product list.
2
votes
2answers
3k views

Where I can file the layout file <update handle=“empty”/> in Magento 2

In /magento2/vendor/magento/module-theme/view/frontend/page_layout/1column.xml I see this tag update handle="empty" Can you please explain what this mean? I thought it's an "include" tag but where is ...
2
votes
4answers
5k views

How to remove html head body tags in layout magento 2

Controller <?php namespace Test\QuickView\Controller\Catalog\Product; class View extends \Magento\Catalog\Controller\Product\View { } Layout quickview_catalog_product_view.xml <?xml ...
2
votes
1answer
2k views

Magento 2 : How to add Conditional Links in Layout?

I've added my custom link to top.links using layout.xml Vendor/Module/view/frontend/layout/default.xml <?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ...
2
votes
2answers
696 views

How do I override layouts.xml - Magento 2

I am trying to override the file app/code/Magento/Theme/view/frontend/layouts.xml I do not want to extend this file, I want to override it so that some of the base design layouts are not available in ...
2
votes
1answer
204 views

Magento 2: What's the `page_layout` folder for?

In addition to containing familiar folders like layout, and templates, a Magento 2 module's view folder also contains a page_layout sub-folder. view/adminhtml/page_layout view/frontend/page_layout ...
2
votes
3answers
101 views

Move block and set template

I succesfully moved the product related block in my page layout with <move element="catalog.product.related" destination="product.info.right" after='-'/> I want now to apply a custom template ...
2
votes
1answer
428 views

Magento 2 product page include custom phtml file before reviews section

Can anyone help me how to include custom phtml file before reviews section in magento2 please find the screenshot below: When i click on the button it is going to add to cart. Thanks
2
votes
2answers
434 views

Product details page layout problem, magento 2

In magento 2, Product detail page is coming with different layout, some product render with 1 page column while some with 2 column, i saved all product in admin for NO LAYOUT but its not working, how ...
2
votes
1answer
733 views

M2 Debugging - Layout Container Hints?

In the admin there are three options for debugging your theme layout: Enabled Template Path Hints for Storefront Enabled Template Path Hints for Admin Add Block Names to Hints When at least the ...
2
votes
1answer
1k views

XML Validation and Declaration in Magento 2

If we see and module.xml file or any .xml file there is config tag with some xml code declaration what does it mean? is it required? How it works with Magento 2? for Ex : If you see module.xml ...
2
votes
1answer
4k views

Changing the customer/account layout to 2columns-left in Magento 2

I was easily able to make my entire site in Magento 2 from the default to 2columns-left by a few simple changes in the admin section. I created my own theme with the fallback of the luna theme. All ...
2
votes
1answer
724 views

Magento 2 - Move Block Not Working

I've created a faqs.xml for a bespoke page template and this is my code: <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/...
2
votes
0answers
63 views

1.9: programatically switch CMS page template in Observer

For a bunch of reasons, I'd like to be able to switch a CMS page's template based on some PHP. In config.xml: <frontend> <events> <...
2
votes
2answers
2k views

Magento 2 admin, add new 'Text Field' into order information page?

Using magento 2.2 Admin, I want to add textField into Sale > Order > Information > Order & Account Information like image. How to do?
2
votes
0answers
2k views

Change order of CSS and JS in the <head> section of the page

Where is the block with CSS and JS in the <head></head> rendered? And how to change the order of the elements from that section? (this screenshot is from Magento 2 demo) I'd like to ...
2
votes
0answers
506 views

Magento2 : Page_layout Container And Widget Configuration

I'm new on Magento 2, I have created a custom theme and a custom page_layout in /app/design/frontend/[Vendor]/[ThemeDir]/Magento_Theme/page_layout/homepage.xml <referenceContainer name="page....
2
votes
0answers
1k views

Page layouts in Magento 2 — matching old .phtml files

short of it I need to dynamically set the htmlClass of a <container> that is defined in the layout file. <?xml version="1.0"?> <!-- /** * Copyright © 2015 Magento. All rights ...
1
vote
1answer
33 views

Failing to remove page title

I'm trying to remove page title added from Magento\Downloadable\Controller\Customer\Products::Execute public function execute() { $this->_view->loadLayout(); if ($block = $...
1
vote
3answers
3k views

magento 2 How to add a div in main tag with custom phtml template in custom module

I would like to add a div inside <main id="maincontent" class="page-main"> from my custom module please look at screen shoot: Can you see a class="MYCUSTOMBLOCKHERE" in the image I need to add ...
1
vote
3answers
1k views

Where can I see a different between cacheable=“true” and “false” in layout?

I know this is seem stupid question but I'm a newbie in Magento 2. So I want to ask you guys that Where can I see a different between cacheable ='false' and cacheable='true'?. I checked in Local ...
1
vote
1answer
149 views

Remove Header and Footer as per Config Settings in Custom Module

using Magento 1.9, Can anyone let me know that how can i remove, header or footer as per config settings for my custom module. I tried below but not working: <mymodule_index_index> <...
1
vote
1answer
44 views

Remove the image slider in product detail page

I want to to remove the slider in images What I want it to be like :
1
vote
2answers
1k views

MAGENTO 2 How to Get Current page layout

How do I get current category "page_layout" value? e.g "1 column" or "2 column" and so on. The values from Layout screen shoot bellow.