Forum Discussion

triSolutionFuse's avatar
6 years ago

Text keys override for page title

Hi folks,

For some reason i've been banging my head on this longer than i need to, but do you know why im unable to dynamically pull in the current page title into a text key? Such as:

 

theme-lib.message-list-heading.tkb = ${coreNode.title}

To replace this tkb heading with the current node's page title?

2 Replies

  • triSolutionFuse - You cannot use the codeNode.title in the text key directly, but you can do that in the component or macros.

    Thanks!

  • Because FreeMarker is not supported within text-strings, you can use the ${} syntax to reference other text-keys, but not to call any FreeMarker related objects. What you could do is to use a placeholder and pass in the page title when you call text.format(), e.g:

    theme-lib.message-list-heading.tkb = {0}

    and then in Freemarker do:

    <h1>${text.format('theme-lib.message-list-heading.tkb', coreNode.title)}</h1>