File name shared when using Product Gallery (Expanded and Classic)
-
Hi Anton,
I see that you have created a ticket for us, I have answered you on the ticket. To help the other viewers, I will share here my answers.
The way I could think of to achieve this is by rendering an image context metadata in text overlays. Here is a cookbook on how to do it:
https://cloudinary.com/cookbook/render_image_context_metadata_in_text_overlays
Basically, you need to add metadata in the asset to fetch it and overlay it to the asset.For example, I have an image in my account with the URL: "https://res.cloudinary.com/francistagbo/image/upload/copy.jpg".
Under this image, I have a contextual metadata with key: title and value:title1. To overlay the context metadata in the image, I need to use a variable.
This is the URL of the image with the overlay of the metadata: https://res.cloudinary.com/francistagbo/image/upload/$title_ctx:!title!/l_text:arial_100_bold:$(title),g_south/copy.jpgThen, to use it in the Product Gallery widget, you need to add a transformation like:
transformation: [ { variables: [["$title", "ctx:!title!"]], overlay: {font_family: "Arial", font_size: 120, text: "$(title)"}, gravity: "south", } ]
I have created a sample jsfiddle that you can try: https://jsfiddle.net/2gwbv98k/
Thanks,
Francis
Please sign in to leave a comment.
Comments
1 comment