MrSoulPC915 Posted November 22, 2019 Share Posted November 22, 2019 Good morning, everyone, I'm trying to do something simple, but I can't find any resources, either in the doc or on the web. I'm just looking to add CMS links to a template. For the URL, no problem: {url entity='cms' id='1'} But to get the title of the page from the ID, I searched everywhere, tested a bunch of variables, but impossible. Any idea of the procedure? Link to comment Share on other sites More sharing options...
pullidea-dev Posted July 26, 2021 Share Posted July 26, 2021 Add below function in classes/Tools.php public static function getCMSTitle($id_cms,$id_lang){ $cms = new CMS($id_cms, $id_lang); return $cms->meta_title; } And use this function in your tpl. <a href="{$link->getCMSLink(3)}">{Tools::getCMSTitle(3, $language.id)}</a> Here 3 is id_cms. 2 Link to comment Share on other sites More sharing options...
MrSoulPC915 Posted August 4, 2021 Author Share Posted August 4, 2021 Thank you. I had found this result two years ago and shared the solution on the same topic in the French forum (my bad, I should have shared it on this topic too). Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now