/ Published in: PHP

A function for returning the ID of the current CMS page
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/** * Returns the identifier for the currently rendered CMS page. * If current page is not from CMS, null is returned. * @return String | Null */ public function getCurrentCmsPage() { $dataCurrentPage = $this->getHelper('cms/page')->getPage()->getData(); if ($dataCurrentPage) { $identifierCurrentPage = $dataCurrentPage['identifier']; return $identifierCurrentPage; } return; }
Comments
