How to Get CMS Page Description in Magento – PHP Template Guide

PHPtemplate

I want to echo the description and title of the page.
I tried to load this by:

Name:

<?php echo Mage::app()->getStore()->getName(); ?>

Description:

<?php echo strip_tags($this->getDescription()) ?>

But it does not dispaly anything.
Do I need to load a helper?

Best Answer

CMS page : To get the identifier of the current CMS page you can use

$current_identifier = Mage::getSingleton(‘cms/page’)->getIdentifier();

To get the Page Title :

$current_title = Mage::getSingleton(‘cms/page’)->getTitle();

To get the Page ID :

$current_id = Mage::getBlockSingleton(‘cms/page’)->getPage()->getId();

To get the page content:

$current_content = Mage::getSingleton('cms/page')->getContent();