Skip Navigation

[Resolved] Insert images dynamically from Dynamic Featured Image

This support ticket is created 4 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 8 replies, has 2 voices.

Last updated by Christian Cox 4 years ago.

Assisted by: Christian Cox.

Author
Posts
#2010013
Captura-de-pantalla-2021-04-04-a-las-19.40.11.jpg

Tell us what you are trying to do?
I want to insert in the frontend some images for my listings that I have incluido through Dynamic Featured Image Plugin in in the backend. I can insert the native WP Featured Image dynamically with Toolset but I cant insert the rest of the images uploaded with Dynamic Featured Image Plugin

Is there any documentation that you are following?
No, I didnt find anything.

Is there a similar example that we can see?
No

What is the link to your site?
Now is under construction bat u can see our directory page hidden link

#2010027

Hello, I'm not very familiar with this Dynamic Featured Image plugin, so I did a bit of research to see how it works. Is this the plugin you are referring to?
https://wordpress.org/plugins/dynamic-featured-image/

How would you use these extra featured images in the Block Editor without Toolset? I do not think it is possible...this plugin does not seem to be integrated in the Block Editor, unfortunately. Since WordPress only supports one Featured Image by default, the Block Editor is not designed to support multiple featured images in the editor. So it will be difficult to integrate this field with Blocks and dynamic sources as-is, and will probably require extensive custom code. That is concerning, because it seems their support forum is not very active lately:
https://wordpress.org/support/plugin/dynamic-featured-image/

Have you considered implementing a Toolset Types custom image field instead? It would work similarly, in that you can save multiple images per post, but you will be able to access those images in the Block Editor as dynamic sources when designing templates. What would you like to achieve in the template with these additional images - something like an image slider gallery that shows all the featured images in one gallery, or something more specific, per post, designed in the post editor?

If you can provide a bit more information about what you want to achieve, I can tell you what is possible with Toolset, but unfortunately I do not think we will be able to access the featured images from this plugin very easily in dynamic sources.

#2010029

Hi Christian,
Many thanks for your response.
Really the images uploaded are related with the listings. Any listing have their images (and I have more than 2000 listing with 6000 images).
I will like to implement a Toolset Types custom image field instead, but I dont know if is possible to keep the relationship between listings and their images. Is possible to do that? If not , I suppose I would have to upload everyone, having I?
Thanks in advance.

#2010069

I will like to implement a Toolset Types custom image field instead, but I dont know if is possible to keep the relationship between listings and their images. Is possible to do that?
If there is a way to export the featured image URLs for each post, then you might be able to export the URLs, then import them back into Types custom image fields using a CSV import tool. If there is no easy way to export the featured image URLs for each post, then the solution is more complex. A custom PHP or SQL conversion script is required to process your featured images data and add each image URL as a custom field value, per post.

#2010111

Many thanks again Christian...
I got it. Now I have the csv with 2000 registers with title, permalink and Id of the post plus all the url images I want to include (each one in a different field). Wich CSV import tool can I use?

#2010115

And one more thing, is possible to convert image fields in "image sliders" block instead of "images" blocks with tooltip?
Thanks again.

#2010143

Now I have the csv with 2000 registers with title, permalink and Id of the post plus all the url images I want to include (each one in a different field)....And one more thing, is possible to convert image fields in "image sliders" block instead of "images" blocks with tooltip?
Well, you can use either type of block to display content from custom image fields, but it is important to understand how each block is designed to work with multiple values. Image Slider blocks are designed to display multiple images from one custom field that allows multiple values, with a slider interface to transition between images. To use Image Slider blocks effectively, you would need to import multiple images into a single custom field that supports multiple values, per post. Image Slider blocks are not designed to display multiple images from multiple different custom fields, but it sounds like that might be your intention:
Now I have the csv with 2000 registers with title, permalink and Id of the post plus all the url images I want to include (each one in a different field).
I'm not quite clear if you mean you want to include each image in a different custom field, or if you mean the image URLs are each in a different "field", or "cell", in the CSV file.

Wich CSV import tool can I use?
It depends to some extent on whether you want to import the images into one field that allows multiple values, or if you want to import the images into separate fields. Which do you prefer?

#2010915

Hi Christian,
Really I want to use a group of images for each listing. That mean import the images into one field that allows multiple values. The images archives are uploaded yet.
I saw this video: https://toolset.com/course-lesson/dynamic-galleries-and-sliders-for-templates-displaying-repeating-image-fields/

But how can import and vinculate if I have the csv with the title and the urls images in each row?
Thanks again.

#2011217
Screen Shot 2021-04-05 at 3.43.04 PM.png
Screen Shot 2021-04-05 at 3.24.59 PM.png
Screen Shot 2021-04-05 at 3.22.37 PM.png
Screen Shot 2021-04-05 at 3.20.44 PM.png

Each import tool works differently, so you may need to consult the import tool's documentation or support team. I can tell you that Types repeating image custom fields work by storing each image URL as a separate entry in the postmeta table with a meta_key in the format wpcf-{fieldslug}. So if your Types custom field slug in wp-admin is 'book-img-rept-1', then the key in postmeta table is wpcf-book-img-rept-1. If a post has 4 images in this custom field, it should have 4 entries in the postmeta table for the key wpcf-book-img-rept-1, and each entry will correspond to one image URL.

I just ran a quick test with the WP All Import Pro plugin. It can import from a CSV file that contains the post ID in one column, and each image URL in a separate column. Here is an example of the CSV contents, assuming the post IDs are 123 and 234, and assuming each post has 4 images:

 
ID,wpcf-book-img-rept-1,wpcf-book-img-rept-1,wpcf-book-img-rept-1,wpcf-book-img-rept-1
123,<em><u>hidden link</u></em>
234,<em><u>hidden link</u></em>

I was able to upload this file using WP All Import Pro and configure the import tool to import 4 images for each post into the repeating image field wpcf-book-img-rept-1. See the screenshots here for more information about this.

This is a "best-case" scenario test, where all the posts have exactly 4 images. If some posts have fewer than 4 images, this process might not work as expected, because it would add an empty entry for any missing images. You may need to ask the support team of your import plugin for assistance if you need something specific, since our support team isn't really trained in 3rd-party plugin products. I can give you any information you need from a technical perspective about how Types fields work, so you can communicate with the support team for any import tool effectively.