簡體   English   中英

如何在magento 1.9.2.4的主頁中調用其他模塊塊

[英]How to call the other module block in home page in magento 1.9.2.4

我需要在主頁中顯示博客文章詳細信息。 我已將以下擴展名用於帖子顯示( https://www.magentocommerce.com/magento-connect/nblog-blog-extension-by-neotheme.html )。

 In my loyout.xml :- 

        <neotheme_blog_index_index>
            <update handle="neotheme_blog_default"/>
            <reference name="content">
                <block type="neotheme_blog/post_list" name="post.list">
                    <action method="setSummaryBlockType"><block>neotheme_blog/post_summary</block></action>
                    <action method="setSummaryTemplate"><block>neotheme/blog/post/summary.phtml</block></action>
                    <action ifconfig="blog/customer/enabled" method="setUseCustomerPreferences"><use_customer_preferences>true</use_customer_preferences></action>
                </block>
            </reference>
        </neotheme_blog_index_index>

In Admin side :-

Home cms page :-  I called the block like 
         {{block type="blog/post/list"   name="post.list"  template="neotheme/blog/post/list.phtml"}}

但是什么也沒顯示。 我怎樣才能解決這個問題?

您需要在其中添加自定義塊class_prefix / block

Admin -> System -> Permission -> blocks

在您的情況下,只需添加:

neotheme_blog/post_list 

阻止權限

該設置僅適用於CMS頁面CMS塊

請使用這樣的模板調用圖塊。 對於我來說,有可能糾正您在XML布局中遇到的錯誤。 更好的方法是直接在phtml頁面上使用下面代碼中的bt。

echo $this->getLayout()->createBlock('bannerslider/default')->setTemplate('bannerslider/bannerslider.phtml')->setBannersliderId(1)->toHtml(); 

您也可以從CMS頁面管理員調用阻止。

{{block type="core/template" template="catalog/product/form-top.phtml"}}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM