When I explore the existing skeletons and themes, they all seem to be done using one file, instead of this multiple page method. If the multiple page method is the best way, can someone point me in the direction of an example I can follow? I am having trouble figuring out how to make this work.
I feel like this should work like a foreach loop or something.
For small amounts of content I would suggest sticking with a single page if that works for you. For more complex content in each tab, then a collection of pages probably would work best.
This could be accomplished with a collection similar to how the blog index page works. Simply create a collection of child pages, and loop over them, displaying their content between appropriate HTML. Just look at the blog skeleton for an example on how to do this.
or perhaps a screenshot of what your trying to achieve? I can see a mix of things in here, and none of them are quite ‘finished’. For examples you are using modular pages, but you have no templates/modular/schedule-list.html.twig file to render them.
Basically for the tabs, i changed the modular content to just regular content items. modular content would be a little trickier for your tabs implementation because you need to iterate over it twice. So I removed the _ in the folders, changed the content of the loops to use your child variable and also changed the surrounding page’s collection setup to use @self.children. Pretty much that was it with some tweaking.
For the homepage, i put a find call in at the top of the blog_list twig, and then iterated over that.
Thank you very much. With the tabs, having to go through it twice is where I think I was having the most trouble. Figuring out how to configure that. I have poured over the Grav documentation, but would I benefit more from learning more about TWIG templating? I feel like that is my major short coming in really being able to use Grav to it’s full potential.
Yah this was pretty much twig experience with a little ‘collection’ experience. The problem is collections are so powerful in Grav its actually hard to document them. I put up some ‘testing’ API documentation that actually is pretty useful:
You can have multiple collections per page, that could work, but frankly it might be easier for you to simply put the collection query directly in the twig and use taxonomy. You could even have the teams dynamically set in the page header.
Is there a place where I could see this in action? Either the taxonomy or the dynamic set? My first thought was using taxonomy, but I was unsure how to create a collection that specifically targeted a certain taxonomy.
Neither option is working for me. Not sure what I am missing. If I just use {{ child.header.upcomingrace.image }} I get the result I would expect. I am stumped.
Then look in the messsages tab in the debugger (must be turned on of course). Then you can inspect and dig into the data and see what your getting back.