Add sort option on Service Portal for Catalog search results.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2022 09:55 AM
I am trying to create sortby(Relevance, Newest, Alphabetical) buttons on catalog search page in service portal. My display results are Catalog name, short description, catagory bubbles.
I have tried achieving it by cloning OOTB widget and embedding widget with modifications. But, that process is too complex and is not working.
My html code:
<div ng-class="::{'hidden-xs' : options.hide_xs}">
<div class="panel panel-{{::c.options.color}}">
<div class="panel-heading">
<div class="row content_block no-margin">
<div class="count text sc-text-res-padding" ng-class="(c.title.length > 45) ? 'col-md-12 col-xs-12 col-sm-12' : 'col-md-5 col-xs-5 col-sm-5'">
<h3>{{c.title}}</h3>
</div>
<div class="sorting">
<span class="inline">
<span class="text sort-label">${Sort By}</span>
</span>
<span class="pipe inline">
|
</span>
<span class="sort-list inline">
<ul class="list-inline">
<button class="transparent-button link-color" ng-class="{'active':c.selected_order == 'relevancy'}" aria-label="${Sort by} ${relevance}" ng-click="c.updateResultOrder(data.relevency_data)">${Relevance}</button>
<button class="transparent-button link-color" ng-class="{'active':c.selected_order == item.id}" aria-label="${Sort by} ${Newest}" ng-click="c.updateResultOrder(item)">${Newest}</button>
<button class="transparent-button link-color" ng-class="{'active':c.selected_order == item.id}" aria-label="${Sort by} ${Alphabetical}" ng-click="c.updateResultOrder(item)">${Alphabetical}</button>
<span class="order-icons" ng-show="c.selected_order == item.id">
<span ng-hide="item.order_desc"><i class="fa fa-caret-up" aria-hidden="true"></i>
</span>
<span ng-show="item.order_desc"><i class="fa fa-caret-down" aria-hidden="true"></i>
</span>
</span>
</ul>
</span>
</div>
</div>
need help with client controller & server code.
Thanks & regards in advance.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2022 08:13 AM
santosh - I need to fulfill the same requirement. Were you able to come up with a working solution? If yes, would you be willing to share the solution?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2022 04:12 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2022 07:49 AM
Ok, thank you for responding.