小编Mar*_*ana的帖子

Magento CMS Block Collection,无法按商店ID过滤 - addStoreFilter([storeid])无效

如何过滤cms/block(静态块)集合?

这适用于cms页面:

$model = Mage::getModel('cms/page');
$collection = $model->getCollection()->addStoreFilter(3);
Run Code Online (Sandbox Code Playgroud)

这不起作用(返回未过滤的集合):

$model = Mage::getModel('cms/block');
$collection = $model->getCollection()->addStoreFilter(3);
Run Code Online (Sandbox Code Playgroud)

我也尝试使用资源模型'cms/block'和'cms/block_collection',没有结果.

为什么Magento不合适?!有时我真的开始讨厌Magento了.请帮忙.

php collections magento

3
推荐指数
1
解决办法
5646
查看次数

使用KnpPaginatorBundle的多个模板

我使用KnpPaginatorBundle来管理我网站后台的分页,效果很好

我将其配置为使用自定义模板

knp_paginator:
    template:
        pagination: MyappMainBundle::pagination.html.twig
Run Code Online (Sandbox Code Playgroud)

然后,我想在前台使用相同的包但具有不同的html结构.所以,我的问题是:是否可以为分页设置两个模板?一个用于后台,一个用于前台.

提前感谢您的回答.

php symfony twig knppaginator symfony-2.5

2
推荐指数
1
解决办法
2531
查看次数

Prestashop - 使用帮助形式添加多个类别树

我正在创建一个prestashop模块,需要选择2个类别root.

我尝试添加类型为"categories"的2个字段,但在第二个类别树中,它与第一个树具有相同的ID和相同的名称.

$fields_form[1]['form'] = array(
    'legend' => array(
        'title' => $this->l('Setting'),
    ),
    'input' => array(       
        array(
            'type'  => 'text',
            'label' => $this->l('First column title'),
            'name'  => 'HCA_TITLE_COL1',
        ),
        array(
           'type'  => 'categories',
           'label' => $this->l('Root category'),
           'desc'    => $this->l('Root category of the first column.'),  
           'name'  => 'HCA_CAT_COL1',
           'tree'  => array(
                'id' => 'HCA_CAT_COL1',
                'selected_categories' => array((int)Configuration::get('HCA_CAT_COL1')),
            )
        ),
        array(
            'type'  => 'text',
            'label' => $this->l('Second column title'),
            'name'  => 'HCA_TITLE_COL2',
        ),
        array(
           'type'  => 'categories',
           'label' => $this->l('Root category'),
           'desc' …
Run Code Online (Sandbox Code Playgroud)

php prestashop prestashop-1.6

0
推荐指数
1
解决办法
3347
查看次数