Monthly Archives: April 2014

How can create custom sidebar category menu for AW Blog

1. Create a menu_cat.phtml file in app\design\frontend\default\default\template\aw_blog

<div class=”block block-blog”>
<div class=”block-title”>
<strong><span><?php echo Mage::getStoreConfig(‘blog/blog/title’); ?></span></strong>
<div class=”block-content”>


$collection = Mage::getModel(‘blog/cat’)
->setOrder(‘sort_order’, ‘asc’)
$home_url = Mage::helper(‘core/url’)->getHomeUrl();
<?php if ($collection->count() ): ?>
<div class=”menu-categories”>
<h5><?php echo Mage::helper(‘blog’)->__(‘Categories’); ?></h5>
<?php  foreach ($collection as $item) : ?>
<li><a href=”<?php echo $home_url.’blog/cat/’.$item[‘identifier’]; ?>” ><?php echo $item[‘title’]; ?></a></li>
<?php endforeach; ?>
<?php endif; ?>


2. Create a static block from admin side and a following code in content.

<p>{{block type=”blog/blog” template=”aw_blog/menu_cat.phtml”}}</p>

3. Put below code in 2columns-right.phtml or 2columns-left.phtml


echo $this->getLayout()->createBlock(‘cms/block’)->setBlockId(‘block_identifier_name’)->toHtml();



How to get Current Page URL, Module, Controller and Action Name, CMS Page URL and Current Skin URL in Magento


Mage::app()->getFrontController()->getRequest()->getModuleName();  //Get Current Module Name
Mage::getSingleton(‘cms/page’)->getIdentifier();  // Get Current CMS page
Mage::app()->getFrontController()->getRequest()->getRouteName();  // Get Route Name
Mage::getSingleton(‘cms/page’)->getIdentifier();  // Get Identifier Name

Mage::getDesign()->getSkinUrl(); // Get Current Skin URL