Report any technical problems you discover and discuss solutions.

Responsive Images

Plus d'informations
il y a 8 ans 1 mois #5148 par Jaoton
Responsive Images a été créé par Jaoton
I am currently creating a Xerte class for our organisation, and our usage statistics show, that we have a large variety of screen-sizes used. As a first step towards responsiveness, I was therefore trying to make the images scale in response to screen size, by setting the width argument equal to a percentage value in the html code (i.e. width="50%").

Although this works as intended if executed immediately, if I close and open the source view in the editor, or close the class and open it again, the width tag is deleted. The image is thus unresponsive again.

Is this intended? If so, is there a work-around?

Thanks in advance!

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 8 ans 1 mois #5149 par ronm
Réponse de ronm sur le sujet Responsive Images
Can you share a link to an example?
Or example of the code before and after being stripped?
What page type(s) are you using and what version of Xerte?

When you add images via the wysiwyg editor (rather than for instance via the graphics and sound page) you can set percentage widths in the image properties window rather than having to do so in source view. Those images should then be responsive and the code isn't removed. But that may not be the case if you are using a very old version?

HTH
Ron

Xerte developer & trainer
e-learning & m-learning consultant
mitchellmedia.co.uk | xerteacademy.com | learningapps.co.uk
Note: Support here is voluntary and meant for users to support each other.
Need direct commercial support with Xerte? mitchellmedia.co.uk/contact/

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 8 ans 1 mois - il y a 8 ans 1 mois #5150 par Jaoton
Réponse de Jaoton sur le sujet Responsive Images
Thank you for the quick reply!

I am using box-standard html for the image on a plain text page, which works fine when executed right away:
<img alt="" src=" xerte.filestorage.co.uk/USER-FILES/560-
jonathans/media/Carabiner%20Full.png" style="float:right" width="50%"/>

However, after closing & then opening the source view, the width tag gets deleted:
<img alt="" src=" xerte.filestorage.co.uk/USER-FILES/560-
jonathans/media/Carabiner%20Full.png" style="float:right" />

Similarly, when using the image properties dialogue, I receive the error message "Width must be a number" open inserting a percentage value.

Unfortunately, I am not sure which version of xerte I am using, as my UI does not feature and information on that. Is there a way to find out?

Thanks again
Jonathan
Dernière édition: il y a 8 ans 1 mois par Jaoton.

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 8 ans 1 mois #5151 par ronm
Réponse de ronm sur le sujet Responsive Images
Sounds like you need to upgrade! You can check the version by visiting yourinstalladress/version.txt
I can't remember exactly what version it was added but we've had the ability to add percentage widths in the editor for quite some time now and even before that reduced what was stripped out when added to source. For anyone else reading this please reply with what version you are using so others can also learn from this.
HTH
Ron

Xerte developer & trainer
e-learning & m-learning consultant
mitchellmedia.co.uk | xerteacademy.com | learningapps.co.uk
Note: Support here is voluntary and meant for users to support each other.
Need direct commercial support with Xerte? mitchellmedia.co.uk/contact/

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 8 ans 1 mois #5152 par Jaoton
Réponse de Jaoton sur le sujet Responsive Images
Hi Ron, and again, thank you!

I am using version 3.01.

Jonathan

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 8 ans 1 mois - il y a 8 ans 1 mois #5153 par ronm
Réponse de ronm sur le sujet Responsive Images
If you're still using 3.01 you definitely need to upgrade!
In Xerte years (a bit like dog years) that's extremely old!
We're releasing Xerte X next week which celebrates 10 years since the online version was first released. See xot.xerte.org.uk/play.php?template_id=80 and xot.xerte.org.uk/play.php?template_id=81

HTH
Ron

Xerte developer & trainer
e-learning & m-learning consultant
mitchellmedia.co.uk | xerteacademy.com | learningapps.co.uk
Note: Support here is voluntary and meant for users to support each other.
Need direct commercial support with Xerte? mitchellmedia.co.uk/contact/
Dernière édition: il y a 8 ans 1 mois par ronm.

Connexion ou Créer un compte pour participer à la conversation.

Modérateurs: ronmjultenJohnSmith
Temps de génération de la page : 0.144 secondes
Copyright © 2026 The Xerte Project.
Xerte logo Apereo logo OSI Logo