我試圖更改Magento安裝中的產品頁面。在當前主題中,產品選項顯示在頁面的主要部分。我試圖讓他們出現在更多信息選項卡中。問題似乎在於,產品選項是由XML的結構性塊創建的,我不能將它移動到另一個位置,它需要被「翻譯」。Magento中的不同類型的嵌套塊
這裏是XML的產品選項塊:
<block type="catalog/product_view" name="product.info.options.wrapper" as="product_options_wrapper" template="catalog/product/view/options/wrapper.phtml" translate="label">
<label>Info Column Options Wrapper</label>
<block type="core/template" name="options_js" template="catalog/product/view/options/js.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>
所以這是一個catalog/product_view
塊有向其中加入PHTML的幾個chucnks。好的。但是,創建選項卡的XML要求有所不同。這裏有一個例子:
<block type="catalog/product_view_tabs" name="product.info.tabs" as="info_tabs" template="catalog/product/view/tabs.phtml">
<action method="addTab" translate="title" module="catalog">
<alias>options</alias>
<title>Options</title>
<block>catalog/product_view</block>
<template>catalog/product/view/options/wrapper.phtml</template>
</action>
</block>
的<block>foo/bar_baz</block>
位有顯然是一個不同類型的塊比這裏的主要塊。我怎樣才能在那裏插入結構塊?我試圖獲取它,以便第一個引用的XML blob生成的整個內容包可以用在嵌套在<action method="addTab">
內的<block>
標記中。
加分,什麼是這兩種不同的使用情況<block>
的實際名稱是什麼內容<block>
標籤及其屬性之間的區別,並在這個可愛的綠色地球是否有這種記錄?
這是根據謝爾蓋的回答結束了我工作的XML塊。
<block type="catalog/product_view_tabs" name="product.info.tabs" as="info_tabs" template="catalog/product/view/tabs.phtml" >
<action method="addTab" translate="title" module="catalog">
<alias>product_options_wrapper</alias>
<title>Options</title>
<block>catalog/product_view_description</block>
<template>catalog/product/view/options/wrapper.phtml</template>
</action>
<!-- Inserting an extra block that will generate the content of the Options tab. -->
<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>
</block>
你能否確定你的獎金問題?我確實認爲我可以幫你提供細節,但不能完全理解你的問題。 – Sergey 2012-03-20 20:39:48