Image URL From Dynamic Content

Hi,

Is it possible to get an image’s URL dynamically? I can see that the featured image can be used with dynamic content, but I cannot see an option to get an image element’s URL through dynamic content and populate it in the image element’s Link field.

In addition, I would like to open the image in a lightbox when it is clicked.

is this possible?

Thanks,
Christopher.

Hello Christopher,

Thanks for writing to us.

You can use the Image element link option where you need to click on icon—>select the Featured Image URL option. {{dc:post:featured_image}} Please have a look at the given screenshot given below.

Test-Page-Builder-Pro (23)

Hope it helps
Thanks

Hi Prakash,

Thanks for the reply. As mentioned in the original post, I know how to add the URL for the post’s featured image using dynamic content. My question was, is it possible to add a dynamic URL for the image element?

In other words, if a Pro Layout’s Section > Row > Column has an Image element within it, can the image’s URL by dynamically generated?

Many thanks,
Christopher

Hello Christopher,

Yes, the image element can have a dynamic URL. You may need to use a Looper Provider to be able to dynamically generate the URL. By the way, what is your layout? Is it for archive or single layout?

Best Regards.

Hi Ruenel,

As ever, thanks for your help. In this instance, the Layout is a Single Layout - details in a Secure Note.

Are you able to help with the correct dynamic code for the images to bring through the image URL?

Also, is it possible to open the image, when clicked, as a Lightbox, rather than a simple new tab?

Thanks,
Christopher

Hello Christopher,

Sorry for the confusion, it seems that you are not pulling any dynamic data on the post, please note if you manually add an image on the Image element, regretfully there is no option to dynamically pull the image URL. You can manually insert the image URL from the media.

Hope it helps
Thanks

Hi Prakash,

Thanks. I am aware that I am currently manually populating the image URL in exactly the way you describe above. This is hopefully just a temporary method as I would like to populate the URL dynamically due to the large number of images about to be inserted into the posts.

I would like to replace the manual URL with a dynamic one, but am unsure of the correct looper / {{dc:…}} code to enter.

Thanks again,
Christopher

Hello Christopher,

The dynamic content code would only work or pull the data from the Page, Posts, Custom Post Type, Meta fields/Custom Meta fields, and Taxonomy, by using default WordPress Loop or you can use Looper as well. In your case, your data is not stored here so the dynamic content code would not work here.

If you are trying to create the gallery in the post you can use the ACF as a post meta where you can store the gallery images and call it from the Looper. Please have a look at this video.

Or you can use the default WordPress Gallery. For the gallery, I have created a default WordPress gallery. To create a gallery you need to click on the Add Media button —>Create gallery

Now you need to set the image size column. Please note you need to set the “Link To” as “File”.

It would add a shortcode to your content for the gallery.

For example
[gallery columns="4" link="file" ids="2029,2028,2027,2018,2017,2016,2015,2014"]

After adding the gallery you need to add this shortcode to make the image open in a lightbox on click event.

[lightbox selector=".gallery a"]

Hope it helps
Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.