Coachonko Posted May 2, 2022 Share Posted May 2, 2022 (edited) I can get links to pages with the following smarty tags {$link->getPageLink('contact')|escape:'html':'UTF-8'} {$link->getCategoryLink(4)|escape:'html':'UTF-8'} {$link->getCmsLink(9)|escape:'html':'UTF-8'} Is there a way to get page titles instead of having to use the {l s='title'} tags? Edited May 2, 2022 by Coachonko Link to comment Share on other sites More sharing options...
0 datakick Posted May 2, 2022 Share Posted May 2, 2022 It's doable, but not very friendly. Look what static methods are available in Meta class. You could you getMetaByPage, or getCategoryMetas or getCmsMetas {assign var='contactMeta' value=Meta::getMetaByPage('contact', $lang_id)} {assign var='categoryMeta' value=Meta::getCategoryMetas(4, $lang_id, 'category')} {assign var='cmsMeta' value=Meta::getCmsMetas(9, $lang_id, 'cms')} <pre> contact title = {$contactMeta.title} category title = {$categoryMeta.meta_title} cms title = {$cmsMeta.meta_title} </pre> Link to comment Share on other sites More sharing options...
0 Coachonko Posted May 2, 2022 Author Share Posted May 2, 2022 (edited) Thanks! This can be very useful when there is a large amount of these links, dynamically getting title is much faster than editing translations. 6 hours ago, datakick said: It's doable, but not very friendly. Look what static methods are available in Meta class. You could you getMetaByPage, or getCategoryMetas or getCmsMetas {assign var='contactMeta' value=Meta::getMetaByPage('contact', $lang_id)} {assign var='categoryMeta' value=Meta::getCategoryMetas(4, $lang_id, 'category')} {assign var='cmsMeta' value=Meta::getCmsMetas(9, $lang_id, 'cms')} <pre> contact title = {$contactMeta.title} category title = {$categoryMeta.meta_title} cms title = {$cmsMeta.meta_title} </pre> contactMeta works perfectly categoryMeta works but it seems like thirty bees appends the name of the website to the title, so the output should be processed. The cmsMeta doesn't seem to work. If how do you fetch the name of the page instead of the meta title? Edited May 2, 2022 by Coachonko Link to comment Share on other sites More sharing options...
I can get links to pages with the following smarty tags
{$link->getPageLink('contact')|escape:'html':'UTF-8'} {$link->getCategoryLink(4)|escape:'html':'UTF-8'} {$link->getCmsLink(9)|escape:'html':'UTF-8'}
Is there a way to get page titles instead of having to use the {l s='title'} tags?
Edited by CoachonkoLink to comment
Share on other sites