Skip Navigation

[Resolved] attributes srcset and sizes not showing with types custom image field

This thread is resolved. Here is a description of the problem and solution.

Problem:
Attributes srcset and sizes not showing with types custom image field

Solution:
This feature is set to be implemented and publish with Types version 3.2.

Relevant Documentation:

This support ticket is created 6 years, 3 months 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 4 replies, has 2 voices.

Last updated by eSaner 6 years, 3 months ago.

Assisted by: Minesh.

Author
Posts
#1070380

No, that's not what I'm after. I mean the html img element attributes srcset and sizes. This is nothing css related.

For example:
<img src="hidden link" srcset="hidden link 150w, hidden link 300w" sizes="100vw" />

Also see the attached screenshot. The img element without srcset and sizes is the one generated by the types shortcode.

Wordpress has been able to automatically generate this markup since version 4.4: https://make.wordpress.org/core/2015/11/10/responsive-images-in-wordpress-4-4/

How is it possible to automatically generate this markup with the types shortcode, without doing it manually by using multiple types shortcodes to output the different image size urls?

#1070383

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

So, on this page: hidden link
- do you mean that the second image has correct result with srcset attribute BUT the issue with the first image which is displayed using shortcode:

This does not work:

[types field='image' title='%%TITLE%%' alt='%%ALT%%' size='thumbnail'][/types]

And this works:


new==[types field='image' title='%%TITLE%%' alt='%%ALT%%' size='custom' width='150' height='150' resize='proportional'][/types]

Correct?

#1070395

Sorry, those other images were causing too much confusion. Please visit the page again.

The first image is displayed with the types shortcode. It does not create html markup that includes srcset or sizes.

The second image is inserted using the Add Media button. It does include the srcset and sizes markup.

How can these markup be automatically included with the Types shortcode?

#1071323

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I just found a internal Dev ticket to add this feature and this feature is set to added with Types version 3.2.

Please note that there is no ETA on it.

#1071559

OK. Thanks.