Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Why is poll.xml included? 
 
exmonkey
Jr. Member
 
Avatar
Total Posts:  3
Joined:  2008-08-11
 

Hopefully not a stupid question…

I can see in catalogue.xml that (for example) the right.permanent.callout is called like this:
<block type="core/template" name="right.permanent.callout" template="callouts/right_col.phtml"/>

This is fine - I’ve even worked out how to add my own template/block using the same syntax (although the type=core/template” is still a mystery - is there a page with a list of parameters for block declarations?)

The thing I can’t work out is why the poll still appears. The only place it is mentioned is in the poll.xml. Does this mean that everything with the <reference name="right"> tag in it, in the layout folder gets loaded into the “right” container if it’s available?

If this is the case, why was my file myBlock.xml not loaded?

<layout version="0.1.0">
    <default>

        <!-- 
testblock -->
        <
reference name="right">
                <
block type="core/template" name="right.testblock" template="custom/testBlock.phtml" />
        </
reference>

    </default>
</
layout>

Any help appreciated.

 
Magento Community Magento Community
Magento Community
Magento Community
 
crius
Guru
 
Avatar
Total Posts:  623
Joined:  2007-10-16
Denmark
 

Which layout file you put the block declarations in have nothing to do with where the blocks are shown. The important thing is which page tag you put it in.

In poll.xml, a poll block is declared to be in the right part of all pages. The default tag means all pages. It you replace “default” by “catalog_product_view”, the poll will only show up on the product view page.

If you want to add your own layout file, you have to make your own module with a configuration file that tells Magento to look for myBlock.xml.

There is no list of blocks anywhere, but you can see all the block files in the Block folder of each Magento core module.

 
Magento Community Magento Community
Magento Community
Magento Community
 
exmonkey
Jr. Member
 
Avatar
Total Posts:  3
Joined:  2008-08-11
 
Anders Rasmussen - 05 September 2008 03:30 AM

In poll.xml, a poll block is declared to be in the right part of all pages. The default tag means all pages. It you replace “default” by “catalog_product_view”, the poll will only show up on the product view page.

That’s handy to know cheers

If you want to add your own layout file, you have to make your own module with a configuration file that tells Magento to look for myBlock.xml.

So basically it’s the poll module tells Magento to load in the poll block in any ‘right’ areas.
Would I be correct in thinking then, that in the normal course of events, one would not normally be adding blocks anyway, just modifying existing ones?

One more question - I am guessing that ‘page’ is the root definition for all pages(?), does catalog tends to be the mostly used one loaded into ‘page’?

 
Magento Community Magento Community
Magento Community
Magento Community
 
crius
Guru
 
Avatar
Total Posts:  623
Joined:  2007-10-16
Denmark
 

I don’t know what you need, but Magento allows you to add, remove, move or modify blocks in any way you want.

page.xml sets up the basic structure of your layout, including the “right” block, which is then referenced by e.g. poll.xml. I don’t know what you mean by catalog tends to be the mostly used one.

Please note that layout files are organized by module and not by page. catalog.xml includes all the stuff that has to do with products and categories, and it does not only affect catalog pages. The top navigation for instance, is made by catalog.xml, but it appears on all pages, not only catalog pages.

 
Magento Community Magento Community
Magento Community
Magento Community
 
exmonkey
Jr. Member
 
Avatar
Total Posts:  3
Joined:  2008-08-11
 

you may not have have got what I meant - but you answered my question perfectly. smile

Thanks for taking the time

 
Magento Community Magento Community
Magento Community
Magento Community
 
Petrache Nicolae
Jr. Member
 
Total Posts:  29
Joined:  2010-03-09
 

hello. how can i make the poll apear just in the main page? i want it removed from the rest of the pages. thanks

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top