Search page widget link page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-04-2017 03:14 AM
Hi
I would like to change the page I am taken to when I select a result from the "search page" widget.
I have used Search Sources, and populated the page I would like to go to Under Typeahead > page.
This works if I select the search result from the typeahead search preview.
However, if I submit the search I am taken to the search page, which contains the search page widget mention above to list the results.
Does anybody know how to change the destination when I click on a result in this widget?
I am currently taken to the Form page. If I inspect the search page widget I can see this set as a href:
I do not know how this is defined though.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-04-2017 06:41 AM
Hi Ryan,
You can set the target page within the Search Page widget itself.
For a KB article, for instance, you can change the href within the HTML Template:
<div ng-if="item.type == 'kb'">
<a href="?id=putyourpagehere&sys_id={{item.sys_id}}" class="h4 text-primary m-b-sm block">
Or for a catalog item, you can change the 'item.page = "putyourpagehere";' section in the Server Script.
Hope that helps,
Carl.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2017 01:38 AM
Hi Carl
So I have four search sources / types - 3 of which are record tables (inc, Chg, Prb) and 1 is the service catalog. The service catalog is working well.
My html skills are limited - can you show me exactly where you would add:
<div ng-if="item.type == 'kb'">
<a href="?id=putyourpagehere&sys_id={{item.sys_id}}" class="h4 text-primary m-b-sm block">
The part of the script you need I imagine is:
<div ng-if="data.results.length>0" class="panel-heading break-word">
<h2 class="h4 panel-title">${Search results for '{{data.q}}'}</h2>
</div>
<div role="list" >
<div role="listitem" ng-repeat="item in data.results | orderBy:'score':true | limitTo:data.limit" class="panel-body b-b ">
<div ng-include="item.templateID"></div>
</div>
</div>
</div>
</div>
Below is the result widget inspected. I need if I change the id to my page in that URL it works perfectly, I just don't know how to do that in the html
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-06-2017 06:00 AM
Hi Ryan,
So, apologies, it looks like the OOTB widget is very much amended in Jakarta from Helsinki (which is what we're on).
This might now be a crude way to do it, but it does work:
So, for example, pasting the following code in underneath the <div role="listitem" ng-repeat="item in data.results | orderBy:'score':true | limitTo:data.limit" class="panel-body b-b "> line would sort the KB redirect:
<div ng-if="item.type == 'kb'">
<a href="?id=yourpage&sys_id={{item.sys_id}}" class="h4 text-primary m-b-sm block">
<i class="fa fa-book m-r-sm"></i>
<span ng-bind-html="highlight(item.short_description, data.q)"></span></a>
<p ng-bind-html="highlight(item.text, data.q)"></p>
<span class="text-muted">${Article}: {{item.number}}</span>
<span class="text-muted">
<span class="m-l-xs m-r-xs"> · </span>
${Published}: <sn-day-ago date="item.publishedUTC"/>
</span>
</div>

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-19-2019 05:31 AM