Questions tagged [layout]

Denotes the xml files used to define the block hierarchy which eventually renders the template files.

The layout includes the XML files used to render the template files. Both adminhtml and frontend use the layout files. Layout files are usually used to relate the block and template files so that the template files can access the related functions from their block files.

All module layout files are merged before the layout is processed. Which declarations are used, is determined with layout handles. There are layout handles for each route, for different product types, for "logged in" and "logged out" and others.

The layout handles then define a hierarchy of blocks that are rendered with their toHtml() method, usually with a phtml template.

There are two possible ways to customize the page layout in Magento:

  • Changing layout files.
  • Altering templates.

To change the page wireframe, modify the page layout files; all other customizations are performed in the page configuration or generic layout files.

2663 questions
23
votes
3 answers

Targeting multiple layout handles in layout XML

I have a custom controller accessed at the path /custommodule/customer/info which is loading the 2columns-left.phtml template on the root node as follows:
pspahn
  • 4,648
  • 3
  • 32
  • 58
10
votes
2 answers

Why is there a /base/default/ layout and a /default/default layout?

Why is there a /base/default/ layout and a /default/default layout? This seems confusing and redundant.
CommaToast
  • 396
  • 4
  • 14
8
votes
1 answer

Reference before_body_end doesn't work - after_body_start does?

Starting to think I've lost my mojo... Both blocks named before_body_end and after_body_start are of type core/text_list. However, the following layout xml:
philwinkle
  • 35,751
  • 5
  • 91
  • 145
7
votes
4 answers

Move breadcrumb Block purely via local.xml

I want to move the breadcrumb block purely using local.xml. It needs to be moved from its default location to the content block somewhere for me to output. Usually when moving blocks i would unsetChild and then insert, however, this is making the…
Marty Wallace
  • 5,631
  • 13
  • 65
  • 90
5
votes
1 answer

Calling custom .phtml file in footer?

I am having trouble getting a custom .phtml file to output in the footer. Here is the path to the file: beckin/themesettings/socialaccounts.phtml I created an xml file called beckin_themesettings.xml Here is what I have inside of the xml…
user693
4
votes
2 answers

how to add js in custom module layout xml file

I want to add js in my custom module layout xml file Below is my code: I have added js but I wont be able to see this js in my module…
konika
  • 579
  • 2
  • 7
  • 23
3
votes
4 answers

how can I get sku on product page?

i am adding a phtml with after_body_start reference how do I display the SKU of a product if the phtml is being added to a product page?
Yehuda Schwartz
  • 1,152
  • 3
  • 14
  • 33
3
votes
1 answer

What is the benefit of the letter case conventions in layout xml?

Example scenario: $ grep ^class app/code/local/MyApp/MadCaseExample/Block/CaseMaker/BlockThing.php class MyApp_MadCaseExample_Block_CaseMaker_BlockThing extends MyApp_MadCaseExample_Block_Mce $ grep -iF 'blockthing'…
kojiro
  • 1,048
  • 12
  • 22
3
votes
2 answers

Layout handle from attribute set

I have 2 or 3 different bundle-type products. Generally they all appear the same in the catalog, with differing attribute sets showing/hiding available options. It seems there will eventually be a bundle-type product with a vastly different…
philwinkle
  • 35,751
  • 5
  • 91
  • 145
3
votes
1 answer

Call template from controller

I have a default theme folder with all my templates which is inside mysite/app/code/template/frontend/rwd/default. I have another folder named tree(not inside default theme). I have phtml file inside tree. How do i call that file from controller?…
beginner
  • 109
  • 2
  • 2
  • 8
3
votes
2 answers

Why every layout xml root node has a version

Why does the root layout xml node have a version number: I have searched the source code and cannot find this being used. Is it a feature that never got implemented? or taken out?
Marty Wallace
  • 5,631
  • 13
  • 65
  • 90
3
votes
2 answers

Techniques for Tracking Layout XML Merges

Are there any tools or techniques for identifying the overrides/merges/potential conflicts with layout XML in Magento? I think what I'm looking for is something like n98-magerun's dev:module:rewrite:conflicts command. I use Alan Storm's Layoutviewer…
Rick Buczynski
  • 2,699
  • 14
  • 22
3
votes
1 answer

How can I wrap a div around alert_urls?

Currently, the alert links (when product is back in stock and price change alert) are simply wrapped in paragraph tags. I would like to surround both of these paragraph tags with I've…
Synchronium
  • 294
  • 2
  • 10
2
votes
1 answer

How to get the value of

I have a custom block in my layout file like this: How do I get the value of label from bar.phtml ? Please note I do not want to use setData function to set my…
Hashid
  • 946
  • 2
  • 9
  • 26
2
votes
1 answer

using local.xml to avoid repetition

I hope you don't mind me expanding on this question. Using what's explained I got the css working in my template file. But I have not been able to get it working from local.xml, so I am repeating myself several times within the same layout file. I…
tony09uk
  • 1,707
  • 11
  • 41
  • 56
1
2 3 4