Questions tagged [layout]

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

Filter by
Sorted by
Tagged with
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
3answers
9k views

How to determine all blocks and child blocks attached to a handle?

Is there a way to determine which blocks are attached to a handle and/or what child-blocks a block have?
4
votes
1answer
720 views

Extension loading frontend layout on admin

I believe this is the case, at least. The problem is with an extension called VehicleFits, (it's also on GitHub). EDIT: Here's a bit more configuration info. Magento EE 1.13, VAF 1.34. Originally, ...
2
votes
1answer
241 views

What purpose does getChildHtml('top') and getChildHtml('bottom') have in wishlist/view?

I undersand getChildHtm() is used for rendering child blocks which are connected in layout xml files, but I can not find any template or block named 'top' or 'bottom'. Also both of them are empty ...
5
votes
1answer
6k views

How to Override Mage_Checkout_Block_Links

What is the proper way to override a method, for example, the Mage_Checkout_Block_Links::addCartLink() method. My goal is to add some HTML before the Mage_Checkout_Block_Links::addCartLink() method. ...
22
votes
4answers
44k views

Best Practices Way to Edit Magento Top-Links

Let's say we want to add a shopping cart icon right before the "My Cart" link on Magento's top links (see top links below). What is the best way to do this? Do something to toplinks.php? Do ...
3
votes
2answers
6k views

Conditionally add CSS file in layout XML (local.xml)

I need to add a CSS file in local.xml based on some custom variables. I have 5 CSS files but each time only one needs to be loaded. I only know how to check if a single variable is set in the config. ...
1
vote
1answer
2k views

Override Magento module layout “before/after”

A third-party module inserts a block into the layout via before="-". Is there a way to insert a block before their block without editing the module's xml?
2
votes
1answer
635 views

add block to Authorize.net payment template

in the app/design/frontend/base/default/template/payment/form/cc.phtml template, around line 76, there is a spot to echo out child html. how do I reference that block to add a child into it? I'm ...
2
votes
1answer
4k views

Changing header.phtml for an extension

What is the best practice for the given situation? I'm creating an extension and following Magento's best practices by creating my layout and templates in base/default but putting them in the module ...
15
votes
3answers
20k views

Magento adding CSS and JS includes to the footer

I'm doing some Yslow optimization of my Magento site and am trying to add the CSS and Js to the footer of the site. At the moment I'm using a head reference tag in the layout XML and using addJs and ...
2
votes
1answer
2k views

How to show Grouped or Bundle Products in my custom template?

I created my own template/skin. Simple products show great but others fail. As far as i know, the following lines in the view.phtml allow me to do this: <?php if ($_product->isSaleable() &&...
5
votes
1answer
18k views

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....
0
votes
2answers
804 views

Adding a custom area for blocks in a custom layout

Ok, So I've made a module and use it to manage all the custom layouts on my store. Now I need to just add some blocks to certain pages using the template. I added the following line to my custom ...
1
vote
1answer
1k views

Can't get my module layout to work

I'm just trying to test my module by adding some text to the homepage and I can't seem to get this to work. I'm on Magento 1.7.0.2. Magento is aware of my module, I already checked that. Here is my ...
2
votes
3answers
2k views

Using local.xml, I'm getting “Invalid Nesting” errors

With the aim to simplify a lot of our layout XML, I've moved the pertinent parts of our individual files to one local.xml. Everything works fine. However, in the logs, I see errors like this: ...
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. ...
2
votes
2answers
895 views

How to target a specific Admin Config section with a layout update

It is relatively easy to target the adminhtml_system_config_edit node with layout updates in a layout.xml file by using: <adminhtml_system_config_edit> <reference name="head"> ...
5
votes
3answers
7k views

How to insert core template into product view page before price?

I am trying to insert my core template file in product view page before price using layout xml. I've tried this. <catalog_product_view> <reference name="content"> <block ...
7
votes
2answers
2k views

Magento Core: identical block name in one handle

I want to change the template with block name "persistent.remember.me", but there are two blocks with that same name under the same handle: app/design/frontend/base/default/layout/persistent.xml <...
1
vote
2answers
2k views

layout - call left column block within main column (in the 1column.phtml template)

I have a category list page which uses the 1column.phtml template. However, when the user navigates to a category where there are no subcategories - and only its products are displayed - I would like ...
3
votes
3answers
1k views

Provide properties to views in Magento

In Zend Framework we provide properties to layouts which are then consumed in the view. An example of this would be: $this->layout = new Zend_Layout(); $this->layout->username = 'John'; $...
6
votes
2answers
14k views

Https - layout broken

When I open the site using https://mydomain.com all layout (front/backend) is "broken" and appears inconsistent: The headers contains all js/css but they are loaded with http:// protocol and the css ...
26
votes
3answers
5k views

When to use 'name' and when to use 'as'

I've found that when trying to use the unsetChild method, sometimes I have to use the 'name' attribute and others 'as'. It seems that if a block is added normally, you use 'as' but if it is added to ...
5
votes
1answer
140 views

Block core/list defined outside any layout handle

What does this definition of a block core/list mean, at the very end of checkout.xml, Magento CE 1.7.0.2: [...] </checkout_onepage_failure> <block type="core/list" name="...
3
votes
2answers
5k views

Add a field to a custom Payment method (frontend)

I would like to add a field in the checkout page for a custom payment method. Actually because my method extends CC the form is automatically generated (I have no layout set) look at -> ...
3
votes
1answer
706 views

Is there a list of my account sidebar link names for use with removeLinkByName module?

When trying to remove my account links in the sidebar, using the module outlined here http://www.magentocommerce.com/boards/viewthread/435/#e9 Is there a list of all the names that are associated ...
35
votes
7answers
35k views

Move all Javascript includes to before </body>

Does anyone know how to have all of Magento's JS script tags e.g. <script type="text/javascript" src="http://sitename.com/js/prototype/prototype.js"></script> render out before the closing ...
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 ...
1
vote
2answers
2k views

Is it possible to handle success / error messages from within blocks?

In general, I handle exceptions and display success or error messages within controllers. For example: Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__("The ...
4
votes
2answers
21k views

How to change template of category page depending on category level in code?

I had a project where there was no pattern and I applied all changes of categories layout in Admin area (Catalog->Manage Categories->Custom Design tab). Now I need to have the following: Parent ...
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 ...
22
votes
3answers
4k views

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: <custommodule_customer_info> <...
15
votes
3answers
407 views

The block from my custom module isn't showing up on the product page. How can I debug?

I am making my first custom module, following a tutorial online. I get that I have to create certain XML files for the system to "discover" my module, but even when I break the XML, I don't see any ...
36
votes
6answers
41k views

Debugging layout XML loading

TL;DR: is there a way I can debug the loading of the layout? As I believe one module's layout is conflicting with another. Related to a previous question I made: How to make a module layout to be ...
13
votes
5answers
531 views

How to make a module layout to be shown on all themes

Here is the situation: I have several self made modules, all tested and working using the default theme. Then we bought and installed a new theme. Switched to the new theme and the modules are not ...