欧美三区_成人在线免费观看视频_欧美极品少妇xxxxⅹ免费视频_a级毛片免费播放_鲁一鲁中文字幕久久_亚洲一级特黄

magento創(chuàng)建動態(tài)菜單 Create Dynamic CMS Navig

系統(tǒng) 1871 0

Introduction

As you know in Magento, catalog has dynamic menu but cms doesn’t in frontend.
If you are curios about how to create dynamic menu for CMS which can either be included in left or right sidebar for all CMS pages, then you are in right place.


Steps

1. Create navigation.phtml file
Create nagivation.phtml file in folder: app/design/frontend/[your-interface]/[your-theme]/template/cms/
and add the following code:

    <?php
$cmsPages = Mage::getModel('cms/page')->getCollection()
            ->addStoreFilter(Mage::app()->getStore()->getId())
            ->addFieldToFilter('is_active',1)
            ->addFieldToFilter('identifier', array(
                array(
                    'nin' => array(
                            'home',
                            'no-route',
                            'enable-cookies',
                            'empty'
                        )
                    )
                )
            );
?>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<style type="text/css">
    #cms-navigation a.active { color: red; }?
</style>
<script type="text/javascript">
jQuery.noConflict();
jQuery(document).ready(function() {
    var url = window.location.pathname,
    urlRegExp = new RegExp(url.replace(/\/$/,'') + "$");
    jQuery('#cms-navigation a').each(function(){
        if(urlRegExp.test(this.href.replace(/\/$/,''))){
            jQuery(this).addClass('active');
        }
    });
 });
</script>
<div class="block">
    <div class="block-title">
        <strong><span>CMS Navigation</span></strong>
    </div>
    <div class="block-content">
        <ul id="cms-navigation" style="padding: 10px;">
            <?php
            foreach($cmsPages as $_cms):
                $page = $_cms->getData();
                ?>
                <li><a href="<?php echo $this->getBaseUrl() . $page['identifier']; ?>"><?php echo $page['title']; ?></a></li>
                <?php
            endforeach;
            ?>
 
        </ul>
    </div>
</div>
  
?

OR
You can simply download the navigation.phtml file from [here]

?

2> Include CMS Navigation in Layout
Copy/paste the following XML code in your layout XML file (preferably in your theme’s local.xml file):

    <cms_page_view>
    <reference name="left"><!--or right-->
        <block type="core/template" name="cms-navigation" template="cms/navigation.phtml" before="-" />
    </reference>
</cms_page_view>
  
?

This will automatically include the CMS navigation in layout file.


Notes:
Make sure you select the proper Layout template from CMS form ( Design > Page Layout > Layout ).
For example, in order to include CMS navigation in left column you either have to use: Layout = 2 columns with left bar or 3columns .

?

3> That’s all.

If you visit the CMS pages in frontend you will see navigation with all the CMS pages dynamically included with current one being highlighted (see below snapshot).


This will of course make your CMS pages look more beautiful and user friendlier.

magento創(chuàng)建動態(tài)菜單 Create Dynamic CMS Navigation For Magento Frontend

CMS Navigation

?

Happy E-commerce!

?

來源: http://www.blog.magepsycho.com/create-dynamic-cms-navigation-for-magento-frontend/

?

?

magento創(chuàng)建動態(tài)菜單 Create Dynamic CMS Navigation For Magento Frontend


更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯(lián)系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長非常感激您!手機(jī)微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!?。?/p>

發(fā)表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 国产porn在线| 嫩草影院国产 | 狠狠色噜噜狠狠狠狠米奇777 | 色婷婷影院 | 欧美激情久久欧美激情 | 欧美一级特黄aa大片视频 | 日韩精品一区二 | 综合97| 欧美日韩中文国产一区发布 | 欧美日韩一区二区在线视频播放 | 国产精品久久人妻无码网站蜜臀 | 成人福利在线视频 | 国产精品视频第一页 | 国产成人福利视频在线观看 | 天天射天天草 | 久久一区二区三区四区 | 新久草视频 | 久久人人爽人人爽人人 | 国产成人在线一区二区 | 2022国产91精品久久久久久 | 国产精品久久久久久中文字 | 成人午夜视频在线播放 | 日韩 欧美 国产 师生 制服 | 国产中文字幕在线观看 | 波多野结衣在线观看视频 | 免费黄色电影在线观看 | 久草新在线观看 | 中文字幕天堂在线 | 色爱av | 亚洲影视在线观看 | 全免一级毛片 | 久久草视频这里只精品99 | 亚洲91精品 | jyzzjyzzjyzz日本在线观看 | 久草在线播放视频 | 在线视频国产一区 | 成人欧美一区二区三区黑人3p | 久久久9999久久精品小说 | 激情伊人 | 欧美亚洲精品一区 | 免费日本在线视频 |