Forum Discussion

arthur_'s avatar
arthur_
Guide
7 years ago

Get default sort property for TKB articles

Hi,

 

Admin section allows community managers to set default sorting for articles on a TKB page.

 

Is there possibility to extract this option using API call or context objects?

 

So far I tried to look through documentation and available options in admin_settings.xml, but unfortunately nothing came up.

 

Later has section.article_sort_order parameter available, but it always returns mostRecent as its value, even if, for example, default sorting is set to manual.

 

Thank you very much for your advice!

  • arthur_

    Unfortunately, It would not be possible to get it through the API.  But you can get it using Jquery. 

     

    $('.lia-js-menu-opener.default-menu-option.lia-js-mouseover-menu.lia-link-navigation').text();

    It will return whatever selected option like
    "Top LabelsComments" , "Top LabelsKudos" etc. 

     

    Note: Verify the selector class for your instance. 

2 Replies

  • arthur_

    Unfortunately, It would not be possible to get it through the API.  But you can get it using Jquery. 

     

    $('.lia-js-menu-opener.default-menu-option.lia-js-mouseover-menu.lia-link-navigation').text();

    It will return whatever selected option like
    "Top LabelsComments" , "Top LabelsKudos" etc. 

     

    Note: Verify the selector class for your instance.