Forum Discussion

pradeepc's avatar
8 years ago

LIQL - How to exclude message from board which has setting "Hide messages in this board from lists"

I want to exclude messages from the boards which has setting "Hide messages in this board from lists" using LIQL query. Does anyone have any suggestions?

5 Replies

  • Hi pradeepc  If the setting is "Hide messages in this board from lists" then automatically it will exclude the message from that board.  

  • pradeepc's avatar
    pradeepc
    Guide
    8 years ago

    VikasB I have custom query which fetches latest posts from all the boards and I want to apply this setting in this query.

  • VikasB's avatar
    VikasB
    Boss
    8 years ago

    Hi pradeepc  You are right. It's showing the messages from those boards even setting "Hide messages in this board from lists" is applied. Might be it's an issue on lithium side. You can raise a to confirm it. 
    If you want to exclude the messages from some specific and known boards than you can use the custom approach as well. 

    <#assign excIds = ["Id1", "Id2","Id3"] />  //boards ids from which messages need to be excluded
    <#assign msgs= rest( "2.0", "/search?q=" + "select * from messages order by post_time desc"?url).data />
    <#list msgs.items as msg>
    <#if excIds?seq_index_of(msg.board.id)== -1 >
    //do something here
    </#if>
    </#list>

     

     

  • satya's avatar
    satya
    Expert
    8 years ago

    Hi pradeepc,

     

    Hope this might help you 

    SELECT id, view_href, title, messages.count(*) FROM boards WHERE hidden = false

    Thanks & Regards,

    Srujana Satya Datla.