Jump to content

How To Get Meta_Title Of A Particular Cms Page


Recommended Posts

I'm pretty new to presashop, and I'm currently using a template in prestashop v1.4.0.17. I have customized the tmcategories.tpl to have several of my own links in the header.


Several of the links are pointing to cms pages that I created. Originally I was putting the title right into the link for example:


<li><a href="http://www.myurl.com/cms.php?id_cms=4">About Us</a></li>


But now I would like to change the About Us to that cms pages {$meta_title}

This way the Header links will all correspond to whatever I put in the meta title box on the backend.


I just don't know how to target the meta_title of a particular page.

Another reason I need this to target the backend meta_title section is so that when I add an alternate language it will also show up.


Any help would really be appreciated :)

Link to comment
Share on other sites

If anyone knows how to target a particular pages meta_title I'm still interested; However, I did find another solution.


Mainly I wanted to be able to update my links for Spanish translation. All I had to do was:

use the smarty syntax: {l s='About Us' mod='tmcategoris.tpl'} wherever I wanted to translate.


Then I just navigated to the backend tools=>translations=>modules

And my string showed up with the option to translate.


** At first my translations didn't store. If you have an issue with this I determined a solution regarding this also by:

creating a php.ini file inside my prestashop/admin folder.

Apparently my post_max_size default was 8M and this was too small?


Anyway If you have any comments let me know. Thank you.

Link to comment
Share on other sites

  • 4 months later...

Yo can use the custom function of the class Meta

Meta::getCmsMetas($id_cms, $id_lang, $page_name)

You must set 2 of the 3 variables or "$id_cms & $id_lang" or "$id_lang & $page_name"


that returns an array:

array(3) {
["meta_title"]=> string "The meta title"
["meta_description"]=> string "The meta description"
["meta_keywords"]=> string "The meat keywords"


Wish it helps to someone.


  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...