Posted By

nate63179 on 11/03/09


Tagged

php magento


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

brandonjp


Magento: get current CMS page ID


 / Published in: PHP
 

A function for returning the ID of the current CMS page

  1. /**
  2.  * Returns the identifier for the currently rendered CMS page.
  3.  * If current page is not from CMS, null is returned.
  4.  * @return String | Null
  5.  */
  6. public function getCurrentCmsPage() {
  7. $dataCurrentPage = $this->getHelper('cms/page')->getPage()->getData();
  8. if ($dataCurrentPage) {
  9. $identifierCurrentPage = $dataCurrentPage['identifier'];
  10. return $identifierCurrentPage;
  11. }
  12. return;
  13. }

Report this snippet  

You need to login to post a comment.