Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Manage Top and Bottom/Footer Menu through admin
 
rmeel
Jr. Member
 
Avatar
Total Posts:  23
Joined:  2009-08-20
A- 186, Vaishali Nagr, Jaipur
 

I have used Navigation Bar administrator for menu management. It works fine
Issues

You can also see the hehp for extension at http://www.magentocommerce.com/boards/viewthread/73042/

1) extension ket magento-community/Mage_Navadmin doesnot work
try this http://connect20.magentocommerce.com/community/Mage_Navadmin
2) function getChildHtml not found
Solution :- This is because as mentioned in the description of the extension
Edit: /app/design/frontend/default/THEME/template/page/html/header.phtml
<div class="nav"> <ul id="nav"> <?php echo getChildHtml('topNavadmin') ?> </ul> </div>

Now just have a look at the code, we need to replace the <?php echo getChildHtml('topNavadmin') ?> with <?php echo $this->getChildHtml('topNavadmin') ?> I have added only $this ->obhect to call the function

We can manage the menu items i.e if we a=want to show the menu item under top menu or under footer menu this can be managed by adding few codes :-
For Admin
1) app\code\community\Mage\Navadmin\Block\Adminhtml\Navadmin\Edit\Tab\Form.php
add this code belowposition near about line 53 in order to show where we want to show the menu

$fieldset->addField(’viewinmenu’, ‘select’, array(
‘label’ => Mage::helper(’navadmin’)->__(’View in Menu’),
‘name’ => ‘viewinmenu’,
‘values’ => array(
array(
‘value’ => 1,
‘label’ => Mage::helper(’navadmin’)->__(’Top’),
),

array(
‘value’ => 2,
‘label’ => Mage::helper(’navadmin’)->__(’Footer’),
),

array(
‘value’ => 3,
‘label’ => Mage::helper(’navadmin’)->__(’Left’),
),

array(
‘value’ => 4,
‘label’ => Mage::helper(’navadmin’)->__(’Right’),
),
),
));

2) In database in table “navadmin” add a new field “viewinmenu” of int type

3) app\code\community\Mage\Navadmin\Block\Adminhtml\Navadmin\Grid.php
at line 21 in protected function _prepareColumns add this code near about line 43
$this->addColumn(’viewinmenu’, array(
‘header’ => Mage::helper(’navadmin’)->__(’View in Menu’),
‘align’ => ‘left’,
‘width’ => ‘80px’,
‘index’ => ‘viewinmenu’,
‘type’ => ‘options’,
‘options’ => array(
1 => ‘Top’,
2 => ‘Footer’,
3 => ‘Left’,
4 => ‘Right’,
),
));

Now with these above code we are able to save the menu at its desired position.

For Front

In order to show the menu item for top or bottom we need to edit the function which is called i.e echo $this->helper(’navadmin/data’)->drawItem($aux); or else what we can do is make another function and call it i.e

For top menu items echo $this->helper(’navadmin/data’)->drawItemTop($aux);
For bottom/footer menu items echo $this->helper(’navadmin/data’)->drawItemBottom($aux);

as we have called them we need to make them copy public function drawItem($store_id=1, $pid=0, $level=0) and make 2 new functions
public function drawItemTop($store_id=1, $pid=0, $level=0)
public function drawItemBottom($store_id=1, $pid=0, $level=0)

same as the function drawItem only what we have to edit is call $items = $this->getChildrensTop($store_id, $pid);, $items = $this->getChildrensBottom($store_id, $pid); instead of $items = $this->getChildrens($store_id, $pid);

and make 2 new functions

public function getChildrens($store_id=1, $pid=0){
$out = array();
$collection = Mage::getModel(’navadmin/navadmin’)->getCollection()
->addFieldToFilter(’pid’, array(’in’=>$pid) )
->addFieldToFilter(’store_id’, array(’in’=>$store_id) )
->addFieldToFilter(’status’, array(’in’=>’1’) )
->setOrder(’position’, ‘asc’);
foreach ($collection as $item){
$out[] = $item->getData();
}
return $out;
}

public function getChildrensTop($store_id=1, $pid=0){
$out = array();
$collection = Mage::getModel(’navadmin/navadmin’)->getCollection()
->addFieldToFilter(’pid’, array(’in’=>$pid) )
->addFieldToFilter(’store_id’, array(’in’=>$store_id) )
->addFieldToFilter(’status’, array(’in’=>’1’) )
->addFieldToFilter(’viewinmenu’, array(’in’=>’1’) )
->setOrder(’position’, ‘asc’);
foreach ($collection as $item){
$out[] = $item->getData();
}
return $out;
}

here I have set the filter for the top and bottom menu.

Hope the above mentioned trick solves the issue of dividing the menu items at top or footer or bottom positions

can find the files attachements
1) app\code\community\Mage\Navadmin\Block\Adminhtml\Navadmin\Edit\Tab\Form.php
2) app\code\community\Mage\Navadmin\Block\Adminhtml\Navadmin\Grid.php
3)app\code\community\Mage\Navadmin\Helper\Data.php

remember one thing the function drawItem() is called at app\design\frontend\default\default\template\navadmin\top.phtml
you can place this file at your own template app\design\frontend\default\theme\template\navadmin\top.phtml

for active menu code to work you can take help at http://codefight.org/blog/92/52/How-to-get-current-PageURL-in-Magento-E-commerce

File Attachments
Form.php  (File Size: 4KB - Downloads: 60)
Grid.php  (File Size: 5KB - Downloads: 49)
Data.php  (File Size: 11KB - Downloads: 34)
 
Magento Community Magento Community
Magento Community
Magento Community
 
ecommerceoffice
Member
 
Avatar
Total Posts:  51
Joined:  2011-08-20
Russia
 

in 99% this 2 extensions meets the needs of our Magento clients.
Magento megamenu
Magento tabbed megamenu

 
Magento Community Magento Community
Magento Community
Magento Community
 
zasaintr
Jr. Member
 
Total Posts:  2
Joined:  2012-10-22
 
ecommerceoffice - 02 January 2012 11:06 PM

in 99% this 2 extensions meets the needs of our Magento clients.
Magento megamenu
Magento tabbed megamenu

I think that this forum is for problem solving, not for advertising your paid plugins/services.

 
Magento Community Magento Community
Magento Community
Magento Community
 
magebay
Sr. Member
 
Avatar
Total Posts:  122
Joined:  2012-10-09
Thai Nguyen
 

Check MenuCreatorPro

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top