Hey Everyone,
I’m hoping you all can help me with my site that I’m stuck in. I am trying to display a page with all children assets and apply snippets for each layout. This is what I have (i could be wary off, still learning)
In this layout I was trying to pull in all the content within the folder and using the snippet to format it. Essentially I have a folder with 5 subfolders. I want to display each one formatted within its own DIV.
Hopefully you all understand what I’m trying to do. Thanks for your help.
If I get this right, each of the children is different and should have it’s own separate snippet? If so, you can name the snippets with the name of the child folder like this:
@texnixe Thanks for this!!! So this works to get each child to display the name inside a div. Now is there a way to tell each $child to use a snippet? I tried using
<?php $child = snippet('projhp') ?>
But all that does is apply the snippet to the current parent file.
For not I copied all my code from my “projhp” into the file im working in and changed out all $page to $child. But i would like to add new snippets to multiple layouts to keep things consistant.
Maybe I got it all wrong and I still don’t really understand what you want to achieve, but new try: To use the same snippet over and over again for each child, you just need to put the snippet name in the loop like this: