Dynamic routing with select2 package


#1

I have a collection named games with a field of slug and a field of categories.

I want to use select2 and iron:router to dynamically route based on select2 selection and figure out the best way to setup categories.

I created this crude chart:
https://www.lucidchart.com/documents/view/7d7ae3b7-09eb-4e8c-85a0-7e54f07a9d31

However, I was messing about with the select2 demos and came across the “Multiple select boxes” demo (https://select2.github.io/examples.html).

So, let’s say I come up with the logic to dynamically route from the collection slug field (array) --(action select)–> route (burl/$slug), how would one dynamically render the chosen “Tags”?

Users select the Game from the first select2 field, the template mods renders and the Category select2 field is populated from the Game’s categories field. From there, users can select from the 2nd select2 field which categories they want to load documents of (can select multiple categories like “Tags” from the demo).

I assume that once I get the burl/$game route working that the Category will need to go into a subscription function of sorts (to only show document that match the category array)?