2011-02-05 86 views
0

我是Magento的新手。我需要您的幫助。我想爲magento中的菜單創建一個下拉菜單。當我們拿到鼠標烤箱主菜單時,它會顯示下拉菜單。如何在magento中創建下拉列表

標題導航通過top.phtml

location:app/design/frontend/default/shalu_theme/template/catalog/navigation/top.phtml

在頭其示出了三個主要的類別,還可以管理表示關於前端子類別。 在管理,我有以下

Admin->Catalog->Select Manage Category

 CATEGORY: 
       Furniture(6) 
       Electronics(42) 
       Apparel(66) 

我想創建一個下拉菜單的意思是,這三個main category作爲主標題 navigation.And子類別應顯示給定的三個主要類別落下。

請提供幫助。我是非常感激的向大家

感謝 沙鹿

回答

-1

添加該代碼

<option value="<?php echo $this->getOrderUrl('name', 'asc') ?>"<?php if($this->isOrderCurrent('name') && $this->getCurrentDirection() == 'asc'): ?> selected="selected"<?php endif; ?>> 
Name A-Z 
</option> 

<option value="<?php echo $this->getOrderUrl('name', 'desc') ?>"<?php if($this->isOrderCurrent('name') && $this->getCurrentDirection() == 'desc'): ?> selected="selected"<?php endif; ?>> 
Name Z-A 
</option> 

<option value="<?php echo $this->getOrderUrl('price', 'asc') ?>"<?php if($this->isOrderCurrent('price') && $this->getCurrentDirection() == 'asc'): ?> selected="selected"<?php endif; ?>> 
Price - Low to High 
</option> 

<option value="<?php echo $this->getOrderUrl('price', 'desc') ?>"<?php if($this->isOrderCurrent('price') && $this->getCurrentDirection() == 'desc'): ?> selected="selected"<?php endif; ?>> 
Price - High to Low 
</option> 

<option value="<?php echo $this->getOrderUrl('entity_id', 'desc') ?>"<?php if($this->isOrderCurrent('entity_id') && $this->getCurrentDirection() == 'desc'): ?> selected="selected"<?php endif; ?>> 
Newest Products 
</option> 

<option value="<?php echo $this->getOrderUrl('entity_id', 'asc') ?>"<?php if($this->isOrderCurrent('entity_id') && $this->getCurrentDirection() == 'asc'): ?> selected="selected"<?php endif; ?>> 
Oldest Products 
</option> 
+0

我想這是你發佈此錯題? – Ronn0 2017-07-31 06:40:30

0

那麼當然啦,這是可能的,但它是不是一個真正的「Magento」顯示「下拉」菜單。

默認的Magento是示出在$this->getchild('topmenu')加載'page/html/header.phtml'一棵樹。從那裏你可以玩CSS/JS,使其成爲你想要的下拉菜單。