Skip Navigation

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

Este hilo está resuelto. Aquí tiene una descripción del problema y la solución.

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 hace 5 años, 9 meses. 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.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

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)

Este tema contiene 4 respuestas, tiene 2 mensajes.

Última actualización por eSaner hace 5 años, 9 meses.

Asistido por: Minesh.

Autor
Mensajes
#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="enlace oculto" srcset="enlace oculto 150w, enlace oculto 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

Idiomas: Inglés (English )

Zona horaria: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

So, on this page: enlace oculto
- 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

Idiomas: Inglés (English )

Zona horaria: 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.

Este ticket ya está cerrado. Si eres cliente de Toolset y necesitas ayuda relacionada, abre un nuevo ticket de soporte.