May 2, 20224 yr 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, 20224 yr by Coachonko
May 2, 20224 yr Solution 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>
May 2, 20224 yr Author 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, 20224 yr by Coachonko
Create an account or sign in to comment