i am using a template for which there are two different navigation menu.
Main navigation menu. ( fixed )
Action navigation menu, contains elements such as back, save, delete etc. this navigation elements changes according to the controllers being called. while it may exist for some controller and for some it doesn't
i am making use of layout, and i have placed all the template code in my default.phtml
layout file. the problem i face is for action navigation menu. since the html code for this menu resides in default.phtml
i need to change the content of it according to the controller being called.
i am not sure if this is the right way of doing it. but in my default.phtml
i am checking the controller name and accordingly displaying the menu. this is the code i am using.
<?php if(Zend_Controller_Front::getInstance()->getRequest()->getControllerName() == 'item'): ?>
<!-- Action Navigation Menu -->
<div class="statsRow">
<div class="wrapper">
<a href="#"><img src="/images/icons/dark/add.png" alt="" class="icon"><span>New item</span></a>
<a href="#"><img src="/images/icons/dark/cd.png" alt="" class="icon"><span>Publish / Unpublish item</span></a>
<a href="#"><img src="/images/icons/dark/trash.png" alt="" class="icon"><span>Delete item</span></a>
</div>
</div>
<div class="line"></div>
<?php endif; ?>
is it okay to do it like this? or do i have any better way of doing this?