magento - magento 中 cms block 选择器的 source_model 是什么?

标签 magento model magento-1.12

我想添加一个 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/

相关文章:

Magento 通过系统变量动态更改布局

php - Laravel 什么是使用 HasFactory?

magento - 无法使用 URL 重写重定向 Magento 中的类别

Magento TopLink 缓存我的购物车 (#)

authentication - Magento 1 - 登录后如何重定向到上一页

magento - 在 magento 中隐藏或显示某些类别中的过滤器

magento - 如何为 Magento 的多语言 SEO URL 重写 Nginx

data-binding - 直接在 View 中绑定(bind)模型属性

oracle - Rails 5 - created_at 和 updated_at 类