久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

Magento 靜態頁面菜單

Magento static pages menu(Magento 靜態頁面菜單)
本文介紹了Magento 靜態頁面菜單的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我想制作一個菜單,可以動態顯示來自 CMS 的活動靜態頁面;例如,如果在我的 CMS 中我有這些頁面:

  • 關于我們(已啟用)
  • 航運和退款(禁用)
  • 條款和條件(已啟用)
  • 聯系人(已啟用)

然后菜單看起來像:

關于我們 |條款和條件 |聯系人

我需要一些關于如何開始的提示;也許之前有人已經這樣做了?

解決方案

Dougle非常感謝,真的很有幫助!

聯邦在 Magento CMS 中,您可以制作只能使用其 IDENTIFIER 訪問的靜態頁面;我想要的是以某種方式制作一個菜單,該菜單將自動顯示 ACTIVE(啟用)靜態頁面;如果您將狀態設置為禁用,則不應出現在菜單中;

這是我使用的代碼,注意有 IF $PageData['identifier']!='no-route'; no-rute 是 404 頁面,所以我不需要它在菜單中,但必須啟用,以便 Magento 將 404 錯誤重定向到此頁面;

<?php $collection = Mage::getModel('cms/page')->getCollection()->addStoreFilter(Mage::app()->getStore()->getId());?><?php $collection->getSelect()-> where('is_active = 1');?><ul><?php foreach ($collection as $page): ?><?php $PageData = $page->getData();?><?php if($PageData['identifier']!='no-route') { ?><li><a href="/<?php echo $PageData['identifier']?>"><?php echo $PageData['title'] ?></a><?php } ?><?php endforeach;?>

I want to make a menu that will dynamically show the active static pages from CMS; for example if in my CMS I have these pages:

  • About Us (enabled)
  • Shipping & Refund (disabled)
  • Terms and Conditions (enabled)
  • Contacts (enabled)

then the menu would look like:

About US | Terms and Conditions | Contacts

I need just a few tips on how to get started; maybe somebody has already done this before?

解決方案

Dougle thanks a lot, that was really helpful!

Fede in Magento CMS you can make static pages that you can only access using its IDENTIFIER; what I wanted is somehow make a menu that will automatically display the ACTIVE (enabled) static pages; and if you set status to Disable it should not be in the menu;

here is the code i used, note there is IF $PageData['identifier']!='no-route'; no-rute is the 404 page, so i don't need it in the menu, but it must be enabled so Magento redirects 404 errors to this page;

<div>
    <?php $collection = Mage::getModel('cms/page')->getCollection()->addStoreFilter(Mage::app()->getStore()->getId());?>
    <?php  $collection->getSelect()
          ->where('is_active = 1'); ?>
    <ul>
    <?php foreach ($collection as $page): ?>
      <?php $PageData = $page->getData(); ?>
      <?php if($PageData['identifier']!='no-route') { ?>
      <li>
        <a href="/<?php echo $PageData['identifier']?>"><?php echo $PageData['title'] ?></a>
      </li>
      <?php } ?>
    <?php endforeach; ?>
</div>

這篇關于Magento 靜態頁面菜單的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Joining 2 tables in SELECT(MYSQL/PHP)(在 SELECT(MYSQL/PHP) 中加入 2 個表)
How to make lt;option selected=quot;selectedquot;gt; set by MySQL and PHP?(如何使lt;option selected=“selectedgt;由 MySQL 和 PHP 設置?)
Auto populate a select box using an array in PHP(使用 PHP 中的數組自動填充選擇框)
PHP SQL SELECT where like search item with multiple words(PHP SQL SELECT where like search item with multiple words)
json_encode produce JSON_ERROR_UTF8 from MSSQL-SELECT(json_encode 從 MSSQL-SELECT 產生 JSON_ERROR_UTF8)
MySQL ORDER BY rand(), name ASC(MySQL ORDER BY rand(),名稱 ASC)
主站蜘蛛池模板: 精品香蕉一区二区三区 | 免费网站国产 | 国内自拍偷拍一区 | 亚洲免费观看视频网站 | 午夜看电影在线观看 | 精品视频在线观看 | 日韩中文字幕免费 | 精品久久久久久久久久久 | 亚洲国产一区二区视频 | 天天干国产 | 久久国产欧美一区二区三区精品 | 日日夜夜狠狠操 | 色av一区二区三区 | 国产 日韩 欧美 在线 | 一区二区三区在线观看免费视频 | 在线观看中文字幕一区二区 | 夜夜草天天草 | 成人免费毛片片v | 涩爱av一区二区三区 | 国产一级免费在线观看 | 久草免费在线 | 天天操精品视频 | 亚洲一区av在线 | 亚洲高清视频在线 | 精品国产欧美一区二区三区不卡 | 色888www视频在线观看 | 正在播放国产精品 | 亚洲男人天堂 | 久久极品 | 亚洲欧美一区二区三区国产精品 | 欧美一级网站 | 99精品免费视频 | 美女一级毛片 | 欧美成人高清视频 | 日日射夜夜骑 | av香港经典三级级 在线 | 日本黄色免费大片 | 性欧美精品一区二区三区在线播放 | 精品亚洲一区二区 | 欧美激情一区二区三级高清视频 | 日韩在线不卡视频 |