Forum Discussion

Willem's avatar
Willem
Guide
9 years ago

Showing a custom list of messages

Hi,   On the idea page i try to 'group' the status update posts, and put them on top of the comments. I tried 2 paths, both failing due (my) lack of lithium specific API knowledge.  So i hope you...
  • DougS's avatar
    9 years ago

    Try this:

     

     

    <#assign results_list_size = 20 />
    <#assign max_image_width = settings.name.get("layout.message_body_image_max_size", "1000") />
    <#assign image_resize_css = "lia-message-body-content" />
    <#assign rest_query = "select * from messages where conversation.style='idea' and depth > 0 and topic.id='${idea_id}' and subject matches 'Status changed' limit "+ results_list_size />
    <#assign statusUpdates = rest("2.0","/search?q=" + "select * from messages where conversation.style='idea' and depth>0 and topic.id='${idea_id}' and subject matches 'Status changed' limit 300"?url)/>
    <#if statusUpdates.data?has_content>
      <#list statusUpdates.data.items as message>
        <#assign rest_call = "rest_2.0:/messages/" + message.id />
        <@component id="forums.widget.comment-message-view" message=rest_call maxWidth=max_image_width resizeCss=image_resize_css />
      </#list>
    </#if>

    Does that work for what you are trying to do?

     

    -Doug