How to rearrange the categories on a Catalog?? Please help...

DevSalvo
Tera Contributor

Hi, I know how to change the order on the list at the left but how can I change the order on the Icons in the middle and right? I can't do it through the 'order' value in the categories table. Any ideas? I tried editing the widget but to no avail..

DevSalvo_0-1664815912160.png

 

Thank you for your time and help. 

1 ACCEPTED SOLUTION

eumak
Tera Guru

Hello ,
You can achieve by making some changes in the widget named as "Categories".

var sc = new GlideRecord('sc_category');
sc.addQuery('sys_class_name', 'sc_category');
sc.addActiveQuery();
sc.orderBy('title'); // please edit this line with order in the widget & try it out
data.sc_catalog = $sp.getValue('sc_catalog');
............!


You will find the 
above code in the server side. 

Mark Correct or Helpful if it helps.

Cheers..!
Happy Learning:)
Tushar

 

Mark it as helpful or correct, If Applicable


Cheers..!

Happy Learning:)

Tushar

View solution in original post

5 REPLIES 5

OlaN
Giga Sage
Giga Sage

Hi,

There is a field "order" field on catalog item, which controls which catalog item should be shown first.

It's not displayed in the catalog item OOB, but you can add it, or edit the values directly in the list view.

DevSalvo
Tera Contributor

Thank you very much for your time and your kind response. 
I am using that field but it only rearranges the Categories on the list side (on the panel of the left) 

DevSalvo_0-1664819625830.png

 

But I need to re-arrange the icons on the right, the  "Showing 6 categories of this catalog". If you have any idea on how to do it, I will super appreciate it. 

Once again, thank you for your time and your kind response. 

 

eumak
Tera Guru

Hello ,
You can achieve by making some changes in the widget named as "Categories".

var sc = new GlideRecord('sc_category');
sc.addQuery('sys_class_name', 'sc_category');
sc.addActiveQuery();
sc.orderBy('title'); // please edit this line with order in the widget & try it out
data.sc_catalog = $sp.getValue('sc_catalog');
............!


You will find the 
above code in the server side. 

Mark Correct or Helpful if it helps.

Cheers..!
Happy Learning:)
Tushar

 

Mark it as helpful or correct, If Applicable


Cheers..!

Happy Learning:)

Tushar

DevSalvo
Tera Contributor

Thank you both, and thanks for the solution. the name of the widget was a bit different because it was a copy made from an oob widget and worked by other devs before, but with your advice I was able to find the piece of code in charge of sorting those items and was able to add the .orderBy method. 

Thanks!

DevSalvo_0-1664821598231.png