3

My page.xml file is located at "/app/design/frontend/default/templatefolder/layout/page.xml" and I am able to see all the blocks pointing to particular template(".phtml"). There is a block showing a label as "Main Content Area" and having no template attribute defined in the block element. How can I get to know which phtml file is used for this particular block.

<block type="core/text_list" name="content" as="content" translate="label">
            <label>Main Content Area</label>
        </block>

Can anybody please help on how to find the template file containing the code for main content area ?

2

There is no phtml there. The content container is empty because Magento programagically fills it depending the xml/codes updates depending the url/route you are visiting.

See app/design/frontend/rwd/default/layout/catalog.xml exactly <reference name="content">

<catalog_category_default translate="label">
    <label>Catalog Category (Non-Anchor)</label>
    <reference name="left_first">
        <block type="catalog/navigation" name="catalog.leftnav" after="currency" template="catalog/navigation/left.phtml">
            <block type="core/text_list" name="catalog.leftnav.state.renderers" as="state_renderers" />
        </block>
    </reference>
    <reference name="content">
        <block type="catalog/category_view" name="category.products" template="catalog/category/view.phtml">
            <block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml">
                <block type="core/text_list" name="product_list.name.after" as="name.after" />
                <block type="core/text_list" name="product_list.after" as="after" />
                <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
                    <block type="page/html_pager" name="product_list_toolbar_pager"/>
4
  • Actually I just want to find the slider implemented in the home page. In the admin panel of the magento it is defined as a static block named "showcase". The slider code has prev,next,play,stop buttons. But when looking at the view source of home page it has extra anchor tag added within anchor tag of previous button. I just wanted to know that from where it is added so I can remove it as it is showing validator error in w3 validations. – Pratik Jul 26 '14 at 18:40
  • Not there. If you think your question got an answer mark this as resolved and ask another question specifically about your issue. – mbalparda Jul 26 '14 at 19:15
  • Comment to your answer was not another question but it is related with the question explaining in more detail. – Pratik Jul 26 '14 at 19:22
  • 2
    No. Please ask another question. Do not modify this or it will be closed because the question will loose its original meaning. – mbalparda Jul 26 '14 at 19:35
0

If you would like to know

"How can I see what specific blocks are loaded in the main content area or anywhere on the page render, of a specific(or any) URL in my store?"

To achieve that, I'd advise using external frontend debuggers that have template and block hints:

  1. Commerce Bug 2 (paid) by Alan Storm (lots more then just block/template hints)

    http://store.pulsestorm.net/products/commerce-bug-2

  2. Aoe_TemplateHints (free) – (hover like tool, activated by adding ?ath=1 at the end of the URL you are interested in. Provides various data besides template hints.)

    link to GitHub

  3. Admin Template hints (free)(displays block and template hints, that seems to be about it)

    http://www.magentocommerce.com/magento-connect/admin-template-hints.html

  4. Also there seems to be built-in Template-Hints Magento functionality,

    but I never used it and I am not certain in which versions of Magento it is available. I am only certain there are versions of Magento without it.

I use Commerce Bug and AoE Template Hints, together, and both are invaluable time-savers.

As conclusion, there are probably even more extensions on the web and ways to do this, than just the 4 above, but using any of the sort will save you tons of time, when digging up for such tasks.

0

If there isn't template attribute about block in the layout xml, I think you can find the template file in the block file.

for example:

\app\design\frontend\base\default\layout\catalog.xml

<reference name="content">
    <block type="catalog/category_view" name="category.products" template="catalog/category/view.phtml">
        <block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml">
            <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
               <block type="page/html_pager" name="product_list_toolbar_pager"/>

you can see that the "product_list_toolbar_pager" block have no template file. but you can find the template file in block file as following.

\app\code\core\Mage\Page\Block\Html\Pager.php

protected function _construct()
{
parent::_construct();
$this->setData('show_amounts', true);
$this->setData('use_container', true);
$this->setTemplate('page/html/pager.phtml');
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.