Forum Discussion

phoneboy's avatar
phoneboy
Director
5 months ago
Solved

How do I get the article ID in Freemarker in a TkbArticle?

This is Community Classic. I'm trying to write a component to display something from a hidden field (canonical_url) while on the page of a TkbArticle. It doesn't appear that either page.context.mes...
  • AmanMalhotra's avatar
    5 months ago

    phoneboy 
    We can use the below context object to get the article ID inside the TkbMessage quilt on the TkbArticlePage.
    ${env.context.message.uniqueId}

    For article ID on TkbArticlePage.
    ${page.context.thread.topicMessage.uniqueId}

    For message/comment ID on TkbArticlePage.
    ${page.context.message.uniqueId}