Dynamic load of a gallery

I’m working on a template to show religious heritage sites around Bordeaux – there are over 1200 of them. The plan is to load the data into custom fields in a CPT (from my database) and display them via a template using the dynamic data feature of Bricks Builder. Associated with each site will be two sets of photos, one for a gallery with a few photos for the site’s main page and another for a second page with potentially tens of photos. I’m using HappyFiles to organize the thousands of photos into the two sets by religious site.

All that as background to the question: how do I use dynamic data to specify the photos for the two galleries for each site? Or can I?

I really don’t want to have to construct each of 1200 sites page by hand, only because I have to construct each site’s galleries by hand. Too time-consuming and error-prone!!

What am I missing? Any suggestions, ideas?

Harvey

Hi @maddaze,

you can use the ACF Gallery Field in conjunction with the Gallery Element inside Bricks.

Works perfectly!

Regards,
timmse

1 Like

Timmse,

Perfectly? Are you sure?

I suspect you mean I can dynamically access an ACF Gallery Field from a CPT , created by ACF, within Bricks. I’m not sure that’s a solution, as I have to tie the Gallery Field in those 1200+ records in the CPT created by ACF to 2400+ different Categories in HappyFiles. I suspect the only solution is to acquire ACF and see how it works.

Harvey

Yeah, i am sure that the ACF Gallery Field works perfectly with the Gallery Element, but lets start over.

In general, there is no way to automate your project. Not with Bricks, not with any other PageBuilder or other plugins (at least I don’t know any).

But, if you have already categorized the images in HappyFiles, there are at least two options:

  1. You create your posts and insert the associated HappyFiles folder either via shortcode or as a block directly in Gutenberg (see HappyFiles documentation). In that case you don’t need a custom field plugin like ACF.

  2. Actually, there is no reason to use Custom Fields for your project, as you have already categorized your images and can use the HappyFiles galleries directly (see 1).

If you still want to use custom fields, you must first create the custom fields, assign them to your post type and assign the corresponding images to the gallery field in each individual post (drag and drop). In terms of effort, it is about the same as using the HappyFiles shortcodes.

In addition, I just saw that the gallery field in ACF requires the Pro version (I’ve been using it for years, so I wasn’t aware of that) - so it’s your decision whether you want to spend money on the custom field version or not, although it offers no advantage in this case.

My personal opinion for your specific case: Create your template in bricks and use the “Post Content” element so that you can create your posts quickly and easily with Gutenberg (which, by the way, is also the recommended way) and then simply paste the HappyFiles Gallery Shortcode. Do a hundret per day and you´re done in 12 Days :wink:

This ensures that if you ever change the theme, everything will still work as before (if you continue to use HappyFiles). With Custom Fields this could get a lot more complicated …

In general, given the scope of your project, that’s a lot of work … but I don’t see any other way. Maybe one of the other users still has an idea?

Regards,
timmse

3 Likes

I agree with @timmse. If you want to go with CPT you can try Pods (pods.io). It is free. Don’t know if there is some kind of limitations on the number of photos in gallery field.

Yes, but Pods won’t automate the process of adding the galleries either, so there’s still no advantage using custom fields for this.

Just suggested alternative for ACF Pro… :slight_smile:

I know :wink:

Btw., if there is any developer out there who is willing to develop a plugin that grabs the HappyFile Folders and generate posts out of them… would be the perfect solution :smiley:

Maybe this is a HappyFiles feature request, but I think that you can create the posts faster than the plugin / feature is ready.

Timmse,

Thanks for taking the time to write such a thoughtful response.

When I asked whether you were sure, it wasn’t about whether the ACF Gallery Field works with Bricks. I’m sure it does, since you say so. What I wan asking was whether that was a real solution to my problem.

More background: I wasn’t expecting Bricks to automate the solution. That’s my problem. What I’m looking for is a way to connect a HappyFiles category of images to a particular record in a CPT. My plan is to manually create records in the CPT for three sites, let’s call them Church A, Church B and Church C. Then in HappyFiles I’ll have a category for each site and under each site there’ll be two subcategories, Aperçu (a few photos) and Visite approndie (lots of photos). The problem I want to solve is to connect a template via Dynamic Data to the correct category in HappyFiles and display the photos found there.

Because this Web site will have other sorts of data besides the religious heritage pages and photos, like a resource library, autobiographies, glossary, etc. It seems an excellent idea to separate the religious heritage stuff into its own CPT.

Clever idea to manually populate the many fields in the CPT records in 12 days. Unfortunately, I know from long experience that won’t work for me. Hour after hour repeating the same process for 12 days, I will inevitably and invariably make mistakes. I know that because in classifying the tens of thousands of photos I’ve taken by town and site, I’ve made far too many mistakes. So, no manual process.

How do I plan to automate the creation of the records in the CPT: Once I have the dynamic connection worked out (if I ever do), I’ll export the manually created records and analyze their structure. I’ll then write a PHP program to export the religious site data from the MySQL database where it currently is and reformat it to match the export structure. The final step is to import it into the WordPress database.

For what it’s worth, I’m currently using Pods.

Ah yes, I’d forgotten HappyFiles has a gallery shortcode. That may be the missing piece. Since the categories in HappyFiles have the same names as the towns and sites in the database, maybe I can piece together the shortcode parameters for each CPT record within the PHP program mentioned above. I’ll have to check that.

Harvey

1 Like

It is! Depending on your naming convention of the categories and subcategories, it it definitely an approach!

Maybe you don’t need to write any custom plugin or script for exporting and importing, because there’s WP AllImport/ Export which does a pretty decent job, i think.

Of course, you would have to try to see if this works smoothly in your case…

1 Like

That would be wondeful if possible. However, since I’ll be moving data from a database whose structure has no similarity to that of WP, I have serious doubts about being able to use anything from the WP ecosystem to extract the bits I need from my database.

The only thing you have to take care of: the exported data has to be well structured in a csv or xml file, so it can be imported easily.

Good luck and let us know if you got it working :slight_smile:

Of course CSV – I’m old school. Actually there will be several files to import for different CPTs.

By the way, I do appreciate the time and thought you give to the forum. Merci beaucoup !

Harvey

Like i said, take a look at WPAllimport which is really powerful when it comes to importing (or exporting) regular posts, pages, custom post types, custom fields etc from (or to) a csv or xml… you can also use custom functions during import to manipulate or extend your data.

The Import + Export Pro Package is not cheap, but for what you get, it’s extremely good for a one-time payment i think.

Thanks for your appreciation!

Stefan,

Duly noted. When I get to that point, I’ll investigate further.

Did you find any solution for this? I have a similar problem with much fewer pages to create, but I want to handle it as a template and dynamically display the Happy Files galleries. Can it be solved somehow with ACF Taxonomy Relationship and Gallery ? (just an idea)
@timmse