Forums list + search box

Tomasz Czado asked on June 14, 2016 08:18

I have some functionality to implement and I don't know what buildin functionality can I use (if I can use any at all).

My requirements are: - text field to search forums (forums means topics, not posts) - search should search only in forums topic, teasers or tags (if there is a way to add them on the forum) - search results should show only topics, not posts and if user didn't specified search text, then we should display all forums (topics) - forums list has custom template

Question is which (build-in) web parts should I use and which search index should I use? I realize that I may need to clone web part to implement custom template or create custom search index.

Recent Answers

Bryan Soltis answered on June 14, 2016 15:26

Hi Tomasz,

I'm not sure if it will get everything you need, but the "Forum Search - Advanced dialog" web part allows you to specify only the subject in the searched fields. As far as the results, you should be able to use the "Forum search results" web part to specify your specific transformation.

For both, you probably will need to copy the web part and add your custom code. For the search field, you can look at the ~/CMSWebparts/Forums/Search/ForumExtendedSearchDialog.ascx file to see how you can specify the options to display and how the search action is actually processed. From there, you should be able to build out your specific requirements.

For the index, the above web part actually uses SQL Search, not Smart Search. Because of that, you will not need to build an index as the calls will be made directly against the DB. It's not as efficient of a search as Smart Search, but gives you a lot of control over the actual query execution.

  • Bryan
1 votesVote for this answer Mark as a Correct answer

Tomasz Czado answered on June 14, 2016 23:02

OK, my requirements have changed a little. What if I can list posts, but I still needs to search only in topics / teasers and tags (if somehow we can add them) and also I need to use transformation when displaying search results?

0 votesVote for this answer Mark as a Correct answer

Tomasz Czado answered on June 15, 2016 17:06

I have one last question, how can I display list of forums with repeater (that use transformation)?

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.