Forum Discussion

Hoekstra_VFZ's avatar
4 years ago

Help - Message component to use in Forum Topic Pages

Hi,

We want to highlight certain posts, float them up so to speak, that are important for users to read, but are technically not the solution to the posted problem.

Now we mark them as solution, users don't like it (the mail says the topic is solved), and we have issues counting how much real solutions are given. We want to give the post a tag. All posts with this tag are floated upwards.

The logic is complete, only thing I need is a handy message component to incorporate into my own component. Using @messageUtils.renderMessage I can realize a message component - but not with the topic layout. Instead it has the forum board layout. I checked the corresponding macro, it didn't have what I am looking for.

In short how do i add a message to a forum topic (assigining a specific message id )?

Is there a OOTB component for such a thing? I believe every message in a formum topic is a actually page: Forum Message. This makes things complicated. Below the code of my component so far.

 

<@liaMarkupCache ttl="600" variation="node" anonymousOnly="false" />
<@compress single_line=true>

<#-- import libraries and fetch thread id -->

<#import "theme-lib.common-functions.ftl" as commonUtils />
<#import "custom.message-macros.ftl" as messageUtils />
<#assign threadId = page.context.thread.topicMessage.uniqueId />

<#-- fetch posts (messages) with tag 'uitgelicht' -->

<#assign query = "SELECT id, subject, body, metrics.views, tags, labels, images, post_time, post_time_friendly, conversation.last_post_time, moderation_status, conversation.last_post_time_friendly, author.id,author.login, author.avatar.message, view_href, author.view_href, read_only, author.rank.name, author.rank.color, author.rank.icon_left, author.rank.bold, author.rank.icon_right, author.online_status,board.id, author.avatar.profile, board.view_href, board.title, replies.count(*), kudos.sum(weight), conversation.solved, conversation.style, user_context.read FROM messages WHERE tags.text = 'uitgelicht' AND topic.id = '${threadId}' ORDER BY post_time DESC" />
<#assign highlightedData = commonUtils.executeLiQLQuery(query) />

<#-- Build the thing-->

<div class="lia-text lia-forum-topic-page-reply-count lia-discussion-page-sub-section-header lia-component-reply-count-conditional" style="text-transform: none;">Uitgelicht</div>

<#if highlightedData?has_content>
    <#list highlightedData as msg>
        <@messageUtils.renderMessage msg/>
    </#list>
</#if>

</@compress>

 

  • Hi SuzieH do you know anyone on these forums that has dealt with something similar? If there is a way to get around customizing the macro?

    • SuzieH's avatar
      SuzieH
      Khoros Alumni (Retired)

      HI Hoekstra_VFZ. Thanks for the mention. I'm going to check to see what I can find.