Articles Anywhere

Img filename or path without extension?

4 months 1 day ago #89709

TVBZ's Avatar TVBZ

Hello,

I have some custom media field in my articles. I use these to add profile pictures.

These are jpg's. Now I want to also use pweb version.
Is it in any way possible to use the filename OR filepath without .jpg extension?
Something like [foto output='value' extension='no']?

This would enable me to improve loading time on browsers that support .webp:

<picture>
  <source srcset="[...].webp" type="image/webp">
  <source srcset="[...].jpg" type="image/jpeg"> 
  <img src="[...].jpg" alt="[title]">
</picture>

Please advise, thank you

4 months 1 day ago #89711

Peter van Westen's Avatar Peter van Westen Admin

Currently that isn't possible.
But you should be able to create that entire output (so the whole <picture> block) using layouts.

Then you could simply do something like:

[foto layout="picture"]

See: www.regularlabs.com/extensions/articlesa...a-tags-custom-fields

4 months 1 day ago #89712

TVBZ's Avatar TVBZ

Huh.. Okay.

That's a bit of a challenge but interesting.

I will try that.

Thanks for the insights! 😁