WAIT: Wrong default Image tag inside the builder

Browser: Chrome 110
OS: macOS / Windows / Linux / etc.

Hello team,

In the Image element object, there is no tag options for “img”:

And inside the builder, the default tag for images results to be a “figure”:

Although on frontend, the output is an “img” tag…

if I now set the tag to “custom” and the customTag to “img”, the images are duplicated on the frontend:

I guess because img can’t have children in the DOM. If I select “div”, div becomes the parent of the img tag:

can we make it easier and have an img option set as the default tag and behave the same way as it is now when no tag is set?

Cheers,
Maxime

1 Like

Hi Maxime,
Thanks so much for your report!

However, we are not quite sure what you are getting at.

The image element itself is an img HTML tag, which is wrapped with a figure (e.g. in the case of a caption) or picture tag (if you set sources) depending on the settings, or your custom choice.

That’s invalid HTML since you can’t nest img’s in img’s.

Can you explain in more detail what you mean and the purpose? Thanks!

Best regards,
timmse

Hi @timmse,

It’s not really clear why the “HTML tag” field would target the wrapper while I set the element to be an"img". You could either rename the field to be “wrapper HTML tag”, with “none” as default. But if I set the HTML tag to “img” - which is the final output - I don’t expect to create any wrapper. Just my img with the tag “img”.

I know the average user won’t face any issue with it, but while developing automated processes based on the elements data inside their corresponding objects, this particular setting was getting in the way, and it made no sense to me why the default tag value was set to “figure” even if no UI control was set that way…

Cheers,
Maxime

1 Like

Hey @maximebeguin,

my “opinion” probably does not matter but I also do not exactly understand what you mean. When I insert an image in Bricks without specifying a specific tag an <img> is output in the builder as well as the frontend:

Builder:

Frontend:

So I can’t confirm what you’re saying:

Best,

André

Try to set the html tag “custom” and then “img”, you’ll see what I mean.

But why would I do that if I already get an <img> by default? :sweat_smile:

I explained why: during features development, this setting was getting in the way. It’s specific to the image element - it doesn’t act like all the other elements.

So it’s not about the builder output / builder frontend (as this correctly outputs an <img> tag) but the state in Vue?

For my personal need: yes.

But there’s also a world where ppl could add a non-nestable tag in there, and face issues because it’s not clear that the tag targets the parent element instead of the img element itself.

Ok. I only tried to understand the issue. I wasn’t saying there is none. :slight_smile: Maybe the additional info helps the team to investigate it further – if needed.

Best,

André

1 Like

I understand what @maximebeguin is saying. For improved UX, the tag should be named “Wrapper Tag,” and there should be an option for “none.” That makes it easier to understand.

At one point, I also found it confusing when I didn’t see an option for <img>

3 Likes

Thanks for the additional information :slight_smile:

Honestly, we are still struggling to understand what the problem is, but we are happy to change the label to “HTML tag (wrapper)” if that’s okay with you.

I propose that instead of leaving the tag option blank to get an unwrapped <img> tag, we should include a clear “None” option.

I’ve noticed many people selecting the <figure> tag, primarily because they feel compelled to choose something from the available options.

In addition, I suggest renaming this feature to “Wrapper Tag” or a similar, more descriptive term.

1 Like

As the thread starter, would you please speak up again and let me know what you think about our proposal, @maximebeguin ?

@timmse I still believe that changing the label to “wrapper html” is half of the solution. It doesn’t solve the fact that the vue element object is showing figure as the default tag - while it returns an img on frontend (without any wrapper). That means I have to create a specific condition in my script and can’t trust the default tag value.

I’d rather have:

  1. the label change from “html tag” to “wrapper html tag”
  2. add the default dropdown value to “none”
  3. set img as default tag in the corresponding element object

Cheers

2 Likes

This leads me to ask another question: could you guys provide a list of the Bricks elements that generate “hidden” wrappers? Maybe as an article inside the coming revamped academy? I believe this would be pretty useful for many users - especially when it comes to styling the element using custom css.