
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2022 05:18 AM
Hello,
I try to add a custom Search Source, but I can't get the search results look like I want them to.
I want to add more or other informations to the search results in the faceted search.
These are my settings:
The standard "Search page template" looks like this:
<div>
<a href="?id=form&sys_id={{item.sys_id}}&table={{item.table}}" class="h4 text-primary m-b-sm block">
<span ng-bind-html="highlight(item.primary, data.q)"></span>
</a>
<span class="text-muted" ng-repeat="f in item.fields">
<span class="m-l-xs m-r-xs" ng-if="!$first"> · </span>
{{f.label}}: <span ng-bind-html="highlight(f.display_value, data.q)"></span>
</span>
</div>
The Result looks like this:
I tried a bit and found this "Search page template" to partially work:
<div>
<a href="?id=form&sys_id={{item.sys_id}}&table={{item.table}}" class="h4 text-primary m-b-sm block">
<span ng-bind-html="highlight(item.primary, data.q)"></span>
</a>
<span class="text-muted">${Article}: {{item.fields.number}}</span>
<span class="text-muted">${Article}: {{item.number}}</span>
<span class="text-muted" ng-repeat="f in item.fields">
<span class="m-l-xs m-r-xs" ng-if="!$first"> · </span>
<span class="text-muted">Test</span>
</span>
</div>
with this result:
As you can see I can neither access the item variables through "item.fields.<x>", "item.<x>" nor a simple "Test" span does not work. "Item.sys_id" does resolve to the correct sys_id though.
How can I access the item variables? How can I adjust this search page template to my needs?
Solved! Go to Solution.
- Labels:
-
Service Portal Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2022 04:21 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2022 04:21 PM