Last active
September 9, 2017 02:57
-
-
Save hassadee/ee7ae5136b60ea904185 to your computer and use it in GitHub Desktop.
[PrestaShop Tips] How to get a CMS page title, description, or content in a TPL file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {* | |
| * Usage (Get title): Tools::getCMSTitle($id_cms, $cookie->id_lang) | |
| * Usage (Get Description): Tools::getCMSDescription($id_cms, $cookie->id_lang) | |
| * Usage (Get Content): Tools::getCMSContent($id_cms, $cookie->id_lang) | |
| *} | |
| {* Get CMS Title *} | |
| {Tools::getCMSTitle(1, $cookie->id_lang)} | |
| {* Get CMS Description *} | |
| {Tools::getCMSDescription(1, $cookie->id_lang)} | |
| {* Get CMS Content *} | |
| {Tools::getCMSContent(1, $cookie->id_lang)} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Get CMS Title. | |
| */ | |
| public static function getCMSTitle($id_cms,$id_lang){ | |
| $cms = new CMS($id_cms, $id_lang); | |
| return $cms->meta_title; | |
| } | |
| /** | |
| * Get CMS Description. | |
| */ | |
| public static function getCMSDescription($id_cms, $id_lang){ | |
| $cms = new CMS($id_cms, $id_lang); | |
| return $cms->meta_description; | |
| } | |
| /** | |
| * Get CMS Content. | |
| */ | |
| public static function getCMSContent($id_cms, $id_lang){ | |
| $cms = new CMS($id_cms, $id_lang); | |
| return $cms->content; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment