Magento Forum

Internal Popup using JQuery - Referencing blocks
 
Locker Rushing
Jr. Member
 
Total Posts:  19
Joined:  2008-12-15
 

Quick rundown:

I am working inside: (Option Select template)

Location: app/design/frontend/default/default/template/catalog/product/view/options/type/select.phtml

Question: How can I use something like:

<?php echo $this->getChildHtml('size_chart'?>

and define size_chart in a layout xml.

I basically want to create a size chart internal popup, and want to store the code for the chart outside the select.phtml file.

I am still having trouble wrapping my head around blocks and the xml. I don’t understand the creation process and which layout xml is being used in which module.

The drop down option says it is using the catalog.xml but I can’t reference any blocks from select.phtml.

Any guidance is much appreciated.

I’m loving Magento! Thanks to the creators!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Locker Rushing
Jr. Member
 
Total Posts:  19
Joined:  2008-12-15
 

The thing is there is no reference to the Select block in catalog.xml. It is being added with:

<action method="addOptionRenderer"><type>select</type><block>catalog/product_view_options_type_select</block><template>catalog/product/view/options/type/select.phtml</template></action>

How do I reference this block? When I debug from inside the template file the reference is: “Anonymous 57”.

Also, why are these blocks not declared like the rest of the blocks? Why are they being passed off to this helper method: addOptionRenderer

<block type="catalog/product_view" name="product.info.options.wrapper" as="product_options_wrapper" template="catalog/product/view/options/wrapper.phtml">
    <
block type="catalog/product_view_options" name="product.info.options" as="product_options" template="catalog/product/view/options.phtml">
        <
action method="addOptionRenderer"><type>text</type><block>catalog/product_view_options_type_text</block><template>catalog/product/view/options/type/text.phtml</template></action>
        <
action method="addOptionRenderer"><type>file</type><block>catalog/product_view_options_type_file</block><template>catalog/product/view/options/type/file.phtml</template></action>
        <
action method="addOptionRenderer"><type>select</type><block>catalog/product_view_options_type_select</block><template>catalog/product/view/options/type/select.phtml</template></action>
        <
action method="addOptionRenderer"><type>date</type><block>catalog/product_view_options_type_date</block><template>catalog/product/view/options/type/date.phtml</template></action>
    </
block>
</
block>
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top