- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-03-2014 01:47 PM
Hello--
Can anyone please help me how to configure the Search Results in CMS. I am stuck to get the correct UI Macro/code base which actually generates the search results. My requirement is to display the search results in tabular form (Service Catalog and KB).
I have found that UI Macro "text_search_widget" is being called from "content_search" form. But not sure how this macro generates the search results. I am happy with the search results returned from CMS Search functionality, but just wanted to play with the search content.
I also have looked into ess CMS search implementation and found one UI Macro named "ts_group.xml" is being called (<g:call function="ts_group.xml" group_id="${jvar_ts_groupid}" query="$[sysparm_query]" />) from Dynamic Content - "Search Results". However, could not find any macro named "ts_group", but did find a table of this name. Not sure how they have implemented OoO global/cms search.
Could anyone know from where (code base) the search results are being generated for CMS?
I appreciate your help!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2014 08:32 AM
Are the links getting changed from the DOM manipulation or are they showing up incorrectly to begin with? It looks like it's not set up to show correctly.
When links are generated automatically in the CMS typically Content Types are used. In the Content Types there is some built-in functionality to generated links but sometimes things are done manually to give a little more control. You'll need to look at that. I'd start with making sure you've got a Content Type record defined for the site and table combination that the records are from and that those Content Type records have the Default Detail Page filled in. When you copy a CMS site it will copy the Content Types along with the rest of the content but if you created the site from scratch or just copied pages then you'll need to go in and make copies of the Content Types or create new ones for the site.
If that's all in place then you may need to look at the Summary Template field to make sure it's got code in there to generate the link. It could be a g:content_link tag, but it could also be code to manually create the link.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-04-2014 04:19 AM
Hello there--
I tried with the code base from http://www.servicenowguru.com/system-ui/custom-global-search-page/ and has got something new for the Search page. However, the search result comes as usual in expand/collapse mode, as it comes in ess site/global text search results. This code base also used the same macro (?) as <g:inline template="ts_group.xml"/>.
It seems that "ts_group" is OoB code, which generates the search results in some defined format (expand/collapse) view.
Could anyone knows if we can customize the design of the search results by modifying some code base in SNow. Or if "ts_group" is OoB code and we can't change it.
Regards,
Sudipta

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-04-2014 08:51 AM
By default the CMS search uses the regular global search page, it's just exposed as a block on the CMS page instead of it's own page in the regular frame view. The options are the same for configuring it (what tables are searched and for who) but unfortunately there's not a lot you can configure for the actual look and feel of it.
If you want to do something different there are a few options available to you, but they all will most likely involve writing some Jelly Script. You can do anything from a custom dynamic block where you code everything you want (very advanced) to using a List Block to build your own query and utilize the lists and content types that are already there (less scripting, but may not be flexible enough to accomplish your tabs without some custom coding anyways).
The key is to grab the URL parameter for the search term and to use it in a GlideRecord query. To use the search engine you would use "gr.addQuery('123TEXTQUERY321', search_term);". You could do that in an Advanced Script for a list block and use the list definition and content types to format it or you could do it in a g:evaluate tag in a dynamic block and then use j:while to loop through the results and format them however you want. If you're combining multiple queries then the dynamic block is easier to just write the code, but it's not as flexible is you think it's going to change or if you want to reuse it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-06-2014 01:10 PM
Thanks James.
We have got a way to customize the content in tabbed view using DOM manipulation and applying styles during the page load. However, doing so, the KB links or the SC links are not being mapped to correct KB article pages. Clicking on those links, navigate us to something like below:
Where as, in ess CMS, the links are mapped correctly and navigates to
I copied the same code base from ESS portal for this Search functionality and still not getting the correct mapping (href) for each links.
Could you please let me know if I am missing something?
Regards,
Sudipta

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2014 08:32 AM
Are the links getting changed from the DOM manipulation or are they showing up incorrectly to begin with? It looks like it's not set up to show correctly.
When links are generated automatically in the CMS typically Content Types are used. In the Content Types there is some built-in functionality to generated links but sometimes things are done manually to give a little more control. You'll need to look at that. I'd start with making sure you've got a Content Type record defined for the site and table combination that the records are from and that those Content Type records have the Default Detail Page filled in. When you copy a CMS site it will copy the Content Types along with the rest of the content but if you created the site from scratch or just copied pages then you'll need to go in and make copies of the Content Types or create new ones for the site.
If that's all in place then you may need to look at the Summary Template field to make sure it's got code in there to generate the link. It could be a g:content_link tag, but it could also be code to manually create the link.