Lithium doesn't currently have a way to syndicate a component, or to place a reference to a component into a message or TKB article and have it render somehow. Your only option is to place a custom component on one of the pages you can modify through the Page tab in Lithium Studio.
You have a couple of options as to where you can place a custom component for a TKB article:
- You could add your custom component to the TKBArticlePage (in studio) -- you can place it above or below the article this way.
- You could add your custom component to the TKBMessage page (in studio) -- you can place the custom component closer to the actual article content this way -- a couple things to note about placing your component here:
- Your component can get the currently rendering TKB article using the following freemarker expression:
<#assign message_id = env.context.message.uniqueId />
<#assign message = rest("/messages/id/" + message_id).message />
- I believe it may cause your component to render inside of article comments as well, so you may need to add a conditional to check that this is the root message (because the tkb article is the "root" message and the comments are its "replies"). Something like this should do the trick:
<#assign message_id = env.context.message.uniqueId />
<#assign message = rest("/messages/id/" + message_id).message />
<#if message.root.@href == message.@href>
<#-- add component content here -->
</#if>
The examples above show you how to get a reference to the TKB article (using a server-side REST-like call, which returns a freemarker xml that matches the actual REST API resposne). You can use that object to make additional checks taylored to your business needs to determine whether or not to display the content of the component.
I hope that helps!
-Doug