Forum Discussion
ronaksomani irach15 There is no such query which can help you out to exclude specific board/category. But alternatively, you can achieve it by using change in community structure.
Option 1:
Like you can create 2 categories i.e. Category1 & Category2.
Category1 will contain boards which you want to exclude. Category2 will contain rest of the boards.Now you can use the query
Select * from message where category.id='Category2'Option 2:
<#assign excIds = ["Id1", "Id2","Id3"] />
<#assign boards = rest( "2.0", "/search?q=" + "select * from boards"?url).data />
<#list boards.items as board>
<#if excIds?seq_index_of(board.id)== -1 >
//do something here
</#if>
</#list>ronaksomani - Try this instead, you dont need to use V2 for this, simple if condition can do this.
<#if boardID != "exclude_board">
//run you query here
SELECT * FROM messages WHERE board.id = 'boardID'
</#if>- ronaksomaniMentor
VarunGrazitti : Can I pass list of board-ids to that if condition? As my requirement is to filter all those posts which have mentioned board-ids. Here I can have multiple board-ids which I want to filter.
ronaksomani - how long is the list of the boards to exclude? you can use or condition as below:
<#if boardID != "exclude_bd1" || boardID != "exclude_bd2" || boardID != "exclude_bd3">
</#if>
a more maintainable version:
<#assign excIds = ["Id1", "Id2","Id3"] /> <#if excIds?seq_index_of(boardId)== -1 > //do something here </#if>
Related Content
- 2 months ago