Questions about Magento's layout programming meta-language.
Questions tagged [magento-layout-xml]
61 questions
8
votes
1 answer
Passing a Helper Class a Parameter Through a Layout XML File
I have a working link being added to the top.links block like this:
…

Tyler V.
- 2,471
- 21
- 44
6
votes
2 answers
Order of CSS files. Load module's CSS before theme's CSS
How can I change the order of CSS files to load module's CSS before theme's CSS? Here are some code examples:
Theme's CSS file (loaded on all pages) added in theme's local.xml:
…

zitix
- 810
- 1
- 10
- 26
6
votes
3 answers
How to add JS programmatically in Magento?
I need to add a JS file conditionally and programmatically inside a block file. I tried with these codes:
if (Mage::getStoreConfig('mymodule/settings/enable')) {
$this->getLayout()->getBlock('head')->addJs('path-to-file/file1.js');
} else…

user1576748
- 677
- 3
- 14
- 27
5
votes
3 answers
Magento module layout xml load order
I have a custom extension that includes jQuery through layout XML like so:
Other extensions that use jQuery need to be loaded after…

ringerce
- 533
- 2
- 12
- 25
5
votes
3 answers
How can I hook on scripts and CSS into ?
The thing with the module I am making is that it kind of generates a javascript snippet, so I cannot use an action to just hook that into the section of the HTML since the action requires that I have a JS file (correct me if I am wrong). What are…

Strawberry
- 66,024
- 56
- 149
- 197
4
votes
0 answers
Magento 2 - override layout.xml file within module
Looking at the Magento 2 docs, you can override a base/core layout.xml file - http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/layouts/layout-override.html
Is it possible to do so within a module rather than theme?
Alternatively, is it…

minlare
- 2,454
- 25
- 46
4
votes
2 answers
In Magento 2 how can I retrieve a container from layout?
How can I retrieve a container from the layout programmatically?
I would like to be able to do something like the following...
$container = $layout->getContainer('name');
$container->setAttribute('htmlClass', 'class');

minlare
- 2,454
- 25
- 46
3
votes
1 answer
Load external Javascript before skin Javascript in Magento
I'm trying to add the Google Maps Javascript API to my Magento module.
The problem I'm having is that the core/text block that I am including, that contains the external Javascript inclusion tag, only ever appears after all of the addJs…

Wildcard27
- 1,437
- 18
- 48
3
votes
1 answer
Package’s local.xml not loading when a custom theme with local.xml is active
I have a design package from ThemeForest installed, which has been working just fine, but I am trying to create a new custom theme that consists of a custom.css stylesheet, and a local.xml layout file which only adds a reference to custom.css.
In…

thommie
- 438
- 5
- 22
3
votes
4 answers
Magento - Is it possible to specify multiple values for ifconfig?
I want to specify multiple values for ifconfig in layout xml.
mymodule/test.phtml
Is is possible to add below two conditions for one…

Ankita P.
- 478
- 10
- 21
3
votes
3 answers
Including Magento's "prototype/windows/themes/magento.css" Across Versions
I've got an Magento admin console extension that enables a model window across the entire Magento admin console. In Magento 1.7, I can include the factory default CSS file with the…

Alana Storm
- 164,128
- 91
- 395
- 599
2
votes
1 answer
Magento 2, bring category description at bottom of category page via update layout xml
In magento 2, there is a box in every category page to enter description that displays on top of products in category page, can it be brought at bottom somehow only via update layout xml coding which is under design tab, i want this approach only, i…

Akif
- 21
- 4
2
votes
0 answers
Magento 2 + how to include Bootstrap CSS on top position
I am adding bootstrap css file via default.head.blocks.xml
File including successfully but css file is showing after styles-m.css.
But i want to include it top one position.
Like…

Trliok
- 361
- 1
- 17
2
votes
1 answer
How to set default product sort direction (asc/desc) for few categories only through xml
In Magento 2 how I can set default product sort direction (asc/desc) for specific categories through layout update xml of
Manage Categories ->Specific Category-> Design section.
Like I did in screenshot... But its not working :(

Nafee
- 109
- 1
- 2
- 7
2
votes
2 answers
How can I move Magento's layered Navigation block from left column to right column?
I know that this question has been asked, but I have been unable to find answers that work for me. I have a custom module that I built that also searches for CMS Static pages when giving search results. Within this module, I have a file that updays…

Emil Stewart
- 488
- 1
- 7
- 17