i would like to load pictures of a happy files gallery dynamically into a Bricks gallery.
So i have created a category pictures and a subcategroy faces. I’ve put 5 pictures in the subcategory faces.
Than i’ve created a template with a gallery in Bricks and wanted to automatically load the 5 pictures of the subcategory into the gallery using dynamic data function.
At that point i’m not shure how to do that. Also struggling with the dynamic data options, because i can’t find a good documentation on that.
Any advice appreciated.
Thanks!
BTW: Bricks 1.5.3 and Happy Files 1.6 (standard version)
thanks for the advice. So i have to put the query loop on the container.
Problem: it still doesn’t work as expected. It shows the preview of the pictures and the right amount of pictures in that category = 5, but it doesn’t show the pictures themselves. Any idea what can cause that?
Works now. But i have a problem. Pictures that are imported via query loop are stacked above each other and i don’t understand the picture expands over the full width.
Hi everyone, I just saw this thread as I do have the same problem. Reading through the answers I realized, that (as far as I can tell) @DLR used the image gallery block inside his loop.
This of course creates an image gallery for every image found, which in return renders a huge overhead of DOM elements and is responsible for the weird “stacking” behavior of the images.
In other terms, unfortunatly the media gallery block is not sufficient for query loops. You have to use the actual image block if you want to run a query loop.
This brings me to the question: Why is it not possible to select a media folder when using the image gallery block? Wouldn’t that be the most obvious thing? Or do I miss something?
Just wanted to contribute here because I found a workaround to enable this powerful feature. You must add some PHP code into the mix to accomplish this using the Image Gallery. I used a code snippet plugin to create a custom function that returns all the post IDs of attachments in a given category (I’m using WP ASE’s Media Categories, but the taxonomy will vary depending on what you’re using to categorize your media files). Here is my code:
You must then approve of the custom code in your Bricks settings. After you’ve done so, you can then use {echo:media_by_category("illustration")} (or whatever slug your category is) in the “Dynamic Data” field of your Image Gallery. You can call get_posts() directly with the given attributes, but a custom function is much cleaner. Feel free to reply to this if you have trouble getting yours working!