categoryArray = ids on category names (sub levels to categories)
Template.tasktemplate.helpers({
'crumarray': function(){
var thisurl_catId = Router.current().params._id;
HERE i need some code that take the categoryArray (2,4,6) in one categories _id and match it with categories collection _id and return name like
return (loop) categories from array find category names and show as a breadcrum
},
Since the breadcrumb usually represents the current navigation as a hierarchy, you can structure the url params so that the breadcrumb can be represented mostly with that information. For example, depending on how deep the breadcrumb is,
Then the breadcrumb logic just composes itself based on what is in the url params and query params. It can look up something in mongo if needed, but it doesn’t have to track all the variations of the breadcrumb for every record.
I wouldn’t even use the different categories in the breadcrumb, that is more filter logic for search labels, than hierarchy information.
By tracking state in the url, you get a lot of benefits you can use in your code’s logic. If you are worried about the params logic, you can start off more using mostly query params since they don’t affect the route path directly.