Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2024-04-12 07:34:53

skewray
Member
From: Sunny Southern California
Registered: 2013-04-25
Posts: 200
Website

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

#2 2024-04-12 08:04:36

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,468
Website GitHub

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

#3 2024-04-12 08:14:50

skewray
Member
From: Sunny Southern California
Registered: 2013-04-25
Posts: 200
Website

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

#5 2024-04-12 16:39:19

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,094
Website Mastodon

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

#6 2024-04-13 15:34:02

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,093
Website GitHub Mastodon Twitter

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

#7 2024-04-14 02:08:33

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,220
Website

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

#8 2024-04-14 03:56:47

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,093
Website GitHub Mastodon Twitter

Re: svg images

phiw13 wrote #337098:

Yianis

That requires you save the theme / forms to disk, though.

Indeed


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#9 2024-04-17 23:54:55

skewray
Member
From: Sunny Southern California
Registered: 2013-04-25
Posts: 200
Website

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

#10 2024-04-18 02:25:02

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,220
Website

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

#11 2024-04-18 02:34:52

skewray
Member
From: Sunny Southern California
Registered: 2013-04-25
Posts: 200
Website

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

#12 2024-04-18 03:03:40

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,220
Website

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

Board footer

Powered by FluxBB