Based on this code, https://gist.github.com/claytonzaugg/5cd34c365fbc6d9aa693 is there any reason why I am not getting the list of Categories populated, even though the browser console shows 6 when I type Categories.find().count()?
Iām not very familiar with the Router-stuff. But for me it looks like you are not publishing the contents of Category on the server-side. But if you are seeing the contents of Category in the browser console, the contents are indeed published. Maybe you might want to narrow the problem down. Try to log to the browser console from the Categories-helper method, to see if it is actually called from the template. You might want to take a look into the html structure as well to see if the templates are indeed rendered.
Does an array with 6 documents from the Categories collection show
up in the browser console?
Do each of these have a name field?
When you open the browser console and inspect the DOM, can you see 6 <li>
elements with id="categories" (that really should be changed to a class, by the way ā or, more likely the id="categories" should
be shifted up to the <ul> tag ā and, even then, Iād recommend
changing it to a class)
Iām pretty sure that there is an issue with having a helper with the same name as a collection. In this case, that would be Categories. I suggest changing your helper and template to use categoryList (or similar).
I tried reversing this, still no updates to the DOM with the data from the Categories template. Thanks for the update on proper syntax though! Any other possible solutions?
I updated as well, made sure names were matching, still not getting itā¦ Maybe I need to alter subscriptions perhaps, I only have categories and photos subscribed in the home_controller file. Could that be problematic?
EDIT
Nope, adding subscriptions to categories and photos controllers still no result.
I put the console log in the ListCategories.helpers but did not see the console log. However, on my home page, the MasterLayout, if I run Categories.find().fetch() I can get all six of my categories.
you gotta render your actual template you want to render in the action.
And where does categories_list.html should go? in the home.html? them you gotta actually put it in there. If it goes into its own route, then you are gotta make a ā/categoriesā route or something and in the action you are gotta render THE TEMPLATE categories_list.html
With that being said, seeing as you are starting a new project, please look into flowrouter + blaze layout and template level subscriptions. They will save you more headaches down the road.
ā¦I have no words. Thanks for your help in tracking down my problem. Obvious oversight, but still one none the less, and a great learning experience as I keep trying to understand Meteor. Appreciate the diligence put in!