Forum Discussion

srinivaskiranp's avatar
7 years ago

how can i retrieve Specific Category properties.

In the above picture how can i retrieve "Hide from lists and menus" property for category archive. regards Srinivas Kiran 
  • luk's avatar
    luk
    7 years ago

    srinivaskiranp You can get it either trough API v1 or v2:

    v1 with something like

    <#assign hidden = restadmin("categories/id/<categoryid>/settings/name/config.hidden").value />

    v2 with something like:

    <#assign query = "SELECT hidden FROM categories WHERE id = '<categoryid>'"?url />
    <#assign hidden = restadmin("2.0", "/search?q=${query}").data.items[0].hidden />

    note that you need to set off these requests with admin permissions...