我想添加一个 config
字段到我的 magento 实例。您应该能够在其中存储一个 cms 块。
<block translate="label">
<label>Cms block</label>
<frontend_type>select</frontend_type>
<source_model>???</source_model>
<sort_order>30</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</block>
但我只找到了 cms 页面的模型(
adminhtml/system_config_source_cms_page
)。对应的
source_model
是什么?对于 cms 块?
最佳答案
我认为 Mage_Cms_Model_Resource_Block_Collection 类对此非常有用:
<cms_block translate="label">
<label>Left template CMS block</label>
<frontend_type>select</frontend_type>
<source_model>cms/resource_block_collection</source_model>
<sort_order>0</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
</cms_block>
关于magento - magento 中 cms block 选择器的 source_model 是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17544155/