Forum Discussion
HI Doug, this is great! I have two follow up questions:
1. Can you provide the code if we wanted to limit the content to a particular board or category.
2. Also, if we want the widget to exist on its own page, how would we go about doing that?
Hi Wali -
To limit the search to a category or board you will need to modify the rest call to include that scope. For example, the call for a category page would look like this:
/categories/id/[YOUR CATEGORY HERE]/search/messages/[QUERY STRING PARAMETERS]
A board will be very similiar:
/boards/id/[YOUR BOARD HERE]/search/messages/[QUERY STRING PARAMETERS]
To put the component on a stand alone page, you will need to create a new page in studio (on the Page tab). Then add the component to that page. Keep in mind custom pages are not tied to particular category/board.
- sgyani13 years agoMentor
Hi Kaela,
I am new to the lithosphere but found your post to be exactly what I am looking for - want to enable unanswered thread widget on a particular board. Below is my current component code, but can you please tell me where the board parameter string would go?
<#assign message_list_title = text.format("custom.top_five_threads_with_no_replies.title") />
<#assign results_list_size = 5 />
<#assign rest_query = "/search/messages?openresponse=true&sort_by=-topicPostDate&page_size=" + results_list_size />
<div class="lia-panel lia-panel-standard top-five-threads-with-no-replies-wrapper">
<@component id="forums.widget.message-list-panel" title="${message_list_title}" messages="rest_v1:"+rest_query style="slim" numMessages="conv:"+results_list_size />
</div>- AdamN13 years agoKhoros Oracle
Hi sgyani,
Let's assume that your board id is "board123".
Right now, your search query looks like this:
<#assign rest_query = "/search/messages?openresponse=true&sort_by=-topicPostDate&page_size=" + results_list_size />
This uses the "CommunitySearchContext" to search. To use a "NodeSearchContext", you could do something like this (assuming board id "board123"):
<#assign rest_query = "/boards/id/board123/search/messages?openresponse=true&sort_by=-topicPostDate&page_size=" + results_list_size />
- sgyani13 years agoMentor
Hi Adam
Thanks for that. I created the board specific custom component per your last message. But now I don't know how to add this custom component to the corresponding board only. When I try to do so in Studio, it ends up being a universal implementation based on the selected Page Type.
I logged in as Admin, went to the specific board, and selected Board Admin option. But from there, I do not have the ability to apply this custom component specifically to this board. Do you have any tips for this?
Related Content
- 4 years ago
- 7 months ago
- 13 years agoInactive User
- 3 years ago