HTML Widget: Search multiple places including sub-places

Document created by mattdickens on Apr 22, 2015Last modified by mattdickens on Jun 6, 2017
Version 9Show Document
  • View in full screen mode

So continuing my investigation into providing Widget-based UI features/enhancements without customisations, I've been looking to address a business requirement of several business groups within our organisation to provide a search capability for both multiple places and to include any sub-places such as projects.. I don't really understand why the Jive core product doesn't include a widget that allows a group admin to specify multiple groups and their 'children' but I'm sure there must be a good reason (hint: please share it!).


I started with searching the Jive community and found a few helpful posts, especially Is there an advanced search interface? where DominicG (thanks Dominic) posted a useful script he wrote to allow searching of multiple groups. I set about using this as a great base to produce a script that could be pulled in by an HTML widget and injected onto the parent overview page and would allow a group admin (but non-system admin) to specify which groups/spaces/projects + child places it should search.


Here's how it looks but can be styled to suit your community:





So how do I install this?


The implementation requires two widgets to work:


1) A formatted text widget where the place admin specifies which groups to search.

2) A HTML widget that loads and injects a script + CSS (as a single .html file) from a statics folder or from an attachment on a Jive document which references the formatted text widget to determine which groups to search and then replaces the content of it with a search form.


The idea is that the HTML widget need only be saved by an administrator once to a group that regular users can copy it along with the formatted text widget from onto their own groups. As we don't permit non-system admins from adding JS to widgets, a bit of script in the HTML widget hides the 'Edit this widget' link to deter the group admin from attempting to edit it and stripping out the JS.


The formatted text widget can be structuted any way the group admin likes as long as it contains:


a) @mentioned places that are to be searched

b) the 'trigger text' 'snippet:{buildsearch}' (this can be set to be same as the background colour so users don't see it).






The HTML widget has script such as the following within it although this could be simplified to just deal with .html files rather than css and js files as well.




and then we need the multigroupsearch.html file which I'll also include as an attachment to this post as its pretty long and the formatting gets screwed up then including it inline.

Line 36 above is where the path to this file is specified.




So that's it folks. Normal caveats apply:

  • I'm sure it isn't perfect and could be made more efficient
  • you use it at your own risk


I hope its of some use.