Tuesday, 1 December 2015

Get CMS Page details by Page Id in Magento

Get Page tilte


echo Mage::getModel('cms/page')->load(3)->getTitle();  // Here 3 is page id of about us CMS page


Get Page Url


echo Mage::helper('cms/page')->getPageUrl(3) ; // Here 3 is page id of about us CMS page


Get Page content


echo Mage::getModel('cms/page')->load(3)->getContent(); // Here 3 is page id of about us CMS page



Get excerpt


$content = Mage::getModel('cms/page')->load(3)->getContent(); //  Here 3 is page id of about us CMS page
$excerpt = strip_tags(substr($content,0,300));  // Here300 is character length.
echo $excerpt;

No comments:

Post a Comment