Finding the tags for tag filters via API

PeterC
Excursionist
23 2 1

When setting up a page you can add tag filters which each contain a collection of tags as per this image. 

 

Tag Filters.jpg

 

How do I find these collections via the API?  They seem to be associated with themes in the admin area, yet there seems to be nothing in the themes.json result to give me any clue and I have also looked at collections.  Any help out there on this?  Thanks as ever.

0 Likes
KarlOffenberger
Shopify Partner
1867 182 777

Pages do not have tags so what resource are we talking about then? Collections do have tags but so do blog articles, blogs, products etc.

 

Also, are you looking for the API to fetch the tags or a way to retrieve those tags in the template schema when editing a theme?

 

If API, then you can do following to get blog tags i.e. list of all tags used in articles of blogs. Of course, you could also perform similar for a specific blog (see API docs)

/admin/blogs.json?fields=handle,tags

 

So it depends which resource you meant really (or maybe I am just missing something obvious which wouldn't be the first time ;-)

Liked this post? You might also like our fantastic upsell apps Candy Rack and Candy Cart or offer free gifts with Gift Box. All made with ❤️  and care by Digismoothie
0 Likes
PeterC
Excursionist
23 2 1

Thanks so much for giving me your time.  I don't think the tag collection for a tag filter is a blog - nor can I find it defined in any of the collections I have managed to find, but it seems logical that this tag filter collection, which I assume would have the title 'Filter By' should exist somewhere in the system, though I am fast coming to the conclusion that the API does not expose everything by any means.  Maybe this is another thing that I can't actually get to via the API?  I have tried collects.json, custom_collections.json and smart_collections.json.  I did wonder if it might be within themes/<id>/assets.json but nothing there either.  I want to be able to read the tag list for each 'tag filter' (like my screenshot) dynamically so that if it is changed I can reflect those changes elsewhere.

0 Likes

Hi @PeterC  

 

Did you get any solution?

For Design, Development and custom changes Hire Me.
If your problem solved then Like & Accept this Solution.
Email ID: einsteinnephew@gmail.com
Skype: einsteinnephew.ens1
0 Likes