Forum Discussion

alfozaav's avatar
alfozaav
Helper
2 years ago

Custom message-let component

Hi everyone!

 We want to have a message-list component that shows community-level articles at group hub pages. So our idea is to connect to some API and grab those articles and render them using a custom component.

At the moment, we didn't find a correct API to do that and we can't change the scope of message-list built in component as well.

Do someone have an idea of how to achieve this?

1 Reply

  • Hi alfozaav, what do you mean by "community-level articles"? You want a list of messages from the entire community to display on your group hub? And when you say articles do you mean any style of message or are you looking for specifically TKB articles for example?

    You can use a LiQL query of the messages collection to get what you are looking for. This page messages (khoros.com) has all the different fields and constraints you would want.

    So, for some examples.

    Messages from the entire community:

    SELECT subject, author, board, view_href FROM messages

     

    Only TKB articles (depth=0 gets only top level posts no replies or comments):

    SELECT subject, author, board, view_href FROM messages WHERE conversation.style='tkb' AND depth=0

     

    With freemarker:

    <#assign resp = liql("SELECT subject, author, board, view_href FROM messages WHERE conversation.style='tkb' AND depth=0") />