Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
svg images
I am planning to make most of my images as svg files going forward. The Txp/Images system doesn’t allow them for some reason. Is there a plugin that allows uploading svg files, or should I just dodge the Txp/Images system and upload svg images manually?
Offline
Re: svg images
SVG support has been added to the upcoming 4.9.0 if you can hold off a week or two for the beta?
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Online
Re: svg images
Sweet! I am not in a rush. I knew it had to come along at some point.
Offline
#4 2024-04-12 16:20:41
- pexman
- Member
- Registered: 2016-02-27
- Posts: 63
Re: svg images
Hello, I like to work with SVGs. SVG images can be uploaded via the ‘Files’ tab, just like you upload videos there.
However, you must reference them with their name, not with the number given by the database, as have to be done with the images. That’s why you can’t use the ‘Article image’ form field for this.
Offline
Re: svg images
pexman wrote #337094:
Hello, I like to work with SVGs. SVG images can be uploaded via the ‘Files’ tab, just like you upload videos there.
However, you must reference them with their name, not with the number given by the database, as have to be done with the images. That’s why you can’t use the ‘Article image’ form field for this.
But SVG support is coming soon:
SVG support has been added to the upcoming 4.9.0
So it might be best to hold on and then one can indeed use the ‘Article image’ form field
…. texted postive
Offline
Re: svg images
pexman wrote #337094:
Hello, I like to work with SVGs. SVG images can be uploaded via the ‘Files’ tab, just like you upload videos there.
You can also paste the code of the svg in the forms tab, after you create a mediatype in Preferences>Advanced
[svg]
mediatype="image/svg+xml"
You can then call them using an image tag
<img src="<txp:page_url type="theme_path" />/forms/svg/my_svg.svg" alt="My amazing svg" class="my_class" width="50" height="50">
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: svg images
Yianis
That requires you save the theme / forms to disk, though.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline
Re: svg images
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: svg images
The issue I have noticed, being new to SVG, is the the alt-text does not display for SVG images when displayed using the <img> tag. (I tried Firefox and Opera). Is there a story here?
Offline
Re: svg images
skewray wrote #337101:
The issue I have noticed, being new to SVG, is the the alt-text does not display for SVG images when displayed using the <img> tag. (I tried Firefox and Opera). Is there a story here?
What do you expect to happen – or what would you like to happen?
<img src="my-nice-svg.svg" alt="SVG image representing a lotus">
This displays works perfectly – the text from the alt
attribute would be read aloud by screen readers or other AT.
Did you mean the title
attribute? The text content of which would be displayed as a “tooltip” on mouse-over on devices equipped with a mouse or trackpad.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline
Re: svg images
In Firefox & Opera, when I hover over an <img> with .png, I see the alt-text. I see nothing for a .svg. Just reporting my experience. As far as I know the HTML5 <img> tag doesn’t have a title attribute.
Offline
Re: svg images
I don’t think that is right – and it does not match the behaviour of current Firefox / Safari / Brave. And the title
attribute is perfectly valid for <img />
. If you need to insert a description or caption for the image, a much better way is the <figure />
and <figcaption />
combo.
A little test file
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline