So I have multiple pages, each with multiple videos, each with their own tags. Right now I have the videos in the blueprint as a structure, and each video gets its own tags. What I’m trying to do is have a master video page where all the videos from the respective pages can be filtered by tag. Is this possible?
You can use something similar as proposed in this topic. Basically you would filter by the template that contains videos and then iterate through all items in the structure field.
If you need help with the specific code, please let me know.
Well, but I think you need to collect all structure field items of all subpages into one collection first, so that you can filter by tag afterwards. If you use the toStructure() method, this should work.
(not tackling the tags just yet, just trying to get a list of urls)
Am I missing something? (I didn’t try anything from the first reply, it’s a bit over my head, but I’m willing to.)
By using $pages->find('modules')->children(), you are getting a list of all the children pages. You can’t access the videos field directly on that collection, but you can use the following code:
The tags there aren’t interactive, it just displays a list for now. I tried to get a list of all the tags below, but it seems the $tags array returns every item from the $vid structure instead of just the tags. What’s going on here? Thanks so much!
Edit: it does the same thing (returns every item) when I only have pluck(’’) with nothing inside…