Forum Discussion

Inactive User's avatar
Inactive User
13 years ago

Display Forum Messages in a Custom Component

I'm trying to get the most recent messages from a specific forum to display in a custom component on a category page. I assume there is some way to do this with Freemarker/rest? I just can't seem to find another post on it. Thanks.

  • AdamN's avatar
    AdamN
    13 years ago

    Hi jlutterloh,

     

    To have the message body returned as part of the response for a message, there's an additional parameter you need to include as part of your call:

    restapi.format_detail=full_list_element

     

    For example:

    <#list rest("boards/id/[board-id]/posts/recent?page_size=3&restapi.format_detail=full_list_element").messages.message as message>

     

  • Inactive User's avatar
    Inactive User

    Okay, so I'm able to get some of the information but not the message body using '${message.body}'. It returns an error. Can someone tell me why? Thanks!

     

    <#list rest("boards/id/[board-id]/posts/recent?page_size=3").messages.message as message>
    <a href="${message.@view_href}">${message.subject}</a>

    <span>Posted by ${message.author.login} on ${message.post_time.@view_date}</span>
    </#list>

    • AdamN's avatar
      AdamN
      Khoros Oracle

      Hi jlutterloh,

       

      To have the message body returned as part of the response for a message, there's an additional parameter you need to include as part of your call:

      restapi.format_detail=full_list_element

       

      For example:

      <#list rest("boards/id/[board-id]/posts/recent?page_size=3&restapi.format_detail=full_list_element").messages.message as message>