Forum Discussion

etisson's avatar
2 years ago

only show component if tkb article has a specific label

Hi All,  I'm trying to develop a component that only shows up when a tkb article has a specific tag.  I 'm new to freemarker and liql.  This is what I have so far      <#assign labels = we...
  • VikasB's avatar
    2 years ago

    etisson 

    This is an API to get lebels 

     

    <#assign labels = restadmin("2.0", "/search?q=" + "SELECT text FROM labels WHERE messages.id=${msgid}"?url).data.items![] />​

     

    You can iterate through the labels using a loop and implement specific conditions for particular labels.

  • VikasB's avatar
    VikasB
    2 years ago

    Here you go 

    <#assign messageId = page.context.thread.topicMessage.uniqueId>

    Make sure you are adding it on message page as it will only work on message page. On rest of the pages, it will throw an error.