Magento Expert Forum - Improve your Magento experience
-
How to get CMS page id in Magento?
Actually you can easily manage CMS page from an admin panel. However, you are able to insert blocks in it. For example we have 2 cms pages: contacts and FAQ, these pages include block with banner which appears on each of these 2 pages, but content for this block is based on some PHP code. And if block content somehow depends on the page, we have to use following method.
function getCurrentCmsPage() {
$pageId = Mage::getBlockSingleton('cms/page')->getPage()->getIdentifier();
return $pageId;
}
Done.
Any questions? ask them here
View more threads in the same category:
-
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks