Parameters: Image Element

Hey guys!

We’re trying out the components and parameters features and things are working well for the most part.

However, we’re a bit stuck when using the Image control type as a parameter.

We can’t seem to find a way to map the dynamic content value to the image element so that it will take the parameter value. Unlike other elements, when clicking on the dynamic content icon for the image element, it doesn’t have the Element Parameter option.

When clicking on the alt text field (and other text based fields):

When setting the image source:

Thanks guys!

Hi @xponent21,

Thanks for reaching out.
Unfortunately, the Element Parameter option is not available for the Source attribute of the Image element. I would suggest you go through the following documentation on Element Parameter.

Thanks

Hi @tristup,

Thanks for the reply.

Given that image is one of the available control types, what is the best way to output the image set to that field to an element?

I assume that I could use a Raw Content element and somehow hardcode something like <img src="{{dc:p:the_image}}" />. However, the {{dc:p:the_image}} doesn’t seem to be displaying the URL of the image in the parameter but the image ID and size like 42:full.

Thanks!

Hey @xponent21,

Regretfully, there’s no way to output the image URL at this point. I’ll post this in our internal tracker as a feature request so our development team might add the Element Parameter to the Source in a later version.

Please stay tuned.

Thanks.

Hey @christian,

Just to confirm, are you saying that the Image Control Type: https://theme.co/docs/parameters#control-types-image has no use at the moment?

You might want to add that detail in the docs section or remove it for now to save people time from trying to figure out how to make it work.

Thank you.

Hi @xponent21,

The Control Types: Image which you are referring to is not the Source attribute of the Image element. It is to add a custom parameter to the specific Component.
As my colleague says, he has already added this to our feature request list.

Thanks

Hi @tristup,

I know for a fact that the Image Control type is a parameter that you add to a component. I’ve done that and I was able to add it.

The question I have if it has any use at the moment or not coz:

  • You can’t map as the source of the image element
  • You can’t output the URL of the image that gets added to that component’s parameter.

So what is the use of the image control type parameter if you’re not able to do anything with it?

I would appreciate a clear and a little effort in your response.

Thanks.

Currently to use a parameter in an image element you will need open the WordPress media editor and add your dynamic content from the “Insert from URL” section. We are working to make this a little more clear as well as a new mode called “Inspector Breakout Mode” which will turn most control inputs to text fields so you can easily add in dynamic content to any type of input. Let me know if you have any questions. Have a great day!

Thanks a lot, @charlie. That’s very helpful and finally answers my question.

Have a great day as well!

1 Like

Glad to hear that, @xponent21.

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