Indexing by Tag

Questions, comments, discussions. Over time certain topics might be moved to their own category.
Post Reply
FlightdeckRob
Posts: 12
Joined: Wed Oct 03, 2018 3:54 pm

Indexing by Tag

Post by FlightdeckRob » Wed Nov 28, 2018 7:18 pm

Hi,

I'm trying to get an indexing method working and that's the following:

Document type: Purchase Order
Has Metadata: Created Date (year)
Tagged with the Supplier

I can get the year to work, that one is pretty easy, what I can't get is the second level where I want each Tag to create another sublevel.

I've tried a bunch of things and the closest I can get is:
{{ document.tags.all }}
But that gives a level with the title "<QuerySet [<Tag: TAG LABEL>]> where TAG LABEL is the actual tag label.

Anyone have any ideas on how to get this to just show "TAG LABEL"?

Thanks,

Rob

Krzysztof
Posts: 7
Joined: Wed Aug 22, 2018 11:28 am

Re: Indexing by Tag

Post by Krzysztof » Wed Dec 05, 2018 11:35 am

Rob,

Please check if this is what you need:
{% for tag in document.tags.all %} {{tag.label}} {% endfor %}

Regards,
Krzysztof

FlightdeckRob
Posts: 12
Joined: Wed Oct 03, 2018 3:54 pm

Re: Indexing by Tag

Post by FlightdeckRob » Wed Dec 05, 2018 2:13 pm

That's exactly what I needed! Thanks!

I'm new to this whole thing, would you be able to explain why you need a "for" argument in there?

Thanks,

Rob

KevinPawsey
Posts: 51
Joined: Wed Aug 22, 2018 2:52 pm

Re: Indexing by Tag

Post by KevinPawsey » Wed Dec 05, 2018 2:15 pm

I would love some more details on how to build indexes, as that is the one thing that I am struggling with to be honest.

Is there any reference documents that we can look at, or a list of what is available as built-in variables and how to use them?

I don't mind putting the time in to learn, I just need somewhere to learn from... :roll: :lol:


Kevin

Post Reply