Reputation: 325
I have created 2 CMS pages in magento 1.7.2
Lets say the cms page "About Us" which is the URL
http://localhost/magento/index.php/about-company/?___store=default
and the page "Customer Service" which is the URL http://localhost/magento/index.php/customer-service/?___store=default
In my HEADER.PHTML the line getChildHtml('topMenu') ?> shows the topmenu.
the problem is that the 'topMenu' contains only the categories created by Catalog->Manage Categories
What is the appropriate way to include the 2 cms pages ("About Us" and "Customer Service") in the 'topMenu' ?
Thank you for your help !
Upvotes: 1
Views: 1313
Reputation: 688
Add following code under your /template/page/html/topmenu.phtml
<li title="<?php echo $this->__('About Company') ?>"><a href="<?php echo $this->getUrl('')?>about-company"><?php echo $this->__('About Company') ?></a></li>
Upvotes: 0
Reputation: 605
Create a static block for cms pages from admin and write the below format code
<ul>
<li><a href="{{store direct_url="about-company"}}">About Company</a></li>
<li><a href="{{store direct_url="customer-service"}}">Customer Service</a></li>
</ul>
Call this block in topmenu.phtml (/template/page/html/topmenu.phtml) page
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('cms_pages')->toHtml();?>
Upvotes: 2