Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 Yesterday 11:11:27

etc
Developer
Registered: 2010-11-11
Posts: 5,445
Website GitHub

Re: How do I suppress a "missing form" error?

Bloke wrote #340412:

Any neat alternative deas?

<txp:etc_query url="path_to_svg" markup="xml" /> :-)

Offline

#14 Yesterday 11:23:14

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

Re: How do I suppress a "missing form" error?

etc wrote #340413:

<txp:etc_query url="path_to_svg" markup="xml" /> :-)

Haha. Shall we just remove every single <txp:...> tag in Textpattern 5 and replace it with etc_query? 🤣


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

Offline

#15 Yesterday 11:24:30

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,453
Bitbucket GitHub

Re: How do I suppress a "missing form" error?

Offline

#16 Yesterday 12:24:27

etc
Developer
Registered: 2010-11-11
Posts: 5,445
Website GitHub

Re: How do I suppress a "missing form" error?

Hehe, then my sites seem already running on txp 5.

Actually, <txp:image_info /> is probably not the best place for it, but <txp:evaluate /> might implement some raw xml import/process functionality, since it already uses a dom parser. Even in 4.9, maybe?

Offline

#17 Yesterday 12:34:06

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

Re: How do I suppress a "missing form" error?

etc wrote #340418:

Actually, <txp:image_info /> is probably not the best place for it, but <txp:evaluate /> might implement some raw xml import/process functionality, since it already uses a dom parser. Even in 4.9, maybe?

That’s a great idea. Love it. And not just applicable to images.

If it can be squeezed in now then it rounds off the SVG support nicely and paves the way for other amazing front-end processing tricks.


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

Offline

#18 Yesterday 21:16:55

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,987
Website GitHub

Re: How do I suppress a "missing form" error?

Woah, this thread came a long way since I last checked in. Great feedback and ideas. Philippe, that makes absolute sense what you say. My case is a logo with different coloured parts that change with different backgrounds. I thought i was “being clever” by assigning the path groups inside the svg a css variable as the colour (with fallback) and then setting that variable via css depending on context. But I wonder if it’s backfiring by making the page source larger and not so easily cacheable. What is your educated opiniion on these options:

  1. The ‘clever’ way with the svg inserted into the source two (sometimes three) times with css variables doing the colour switching.
  2. Saving three preset colour variants of the logo and simply inserting the svgs as images. Presumably, the browser doesn’t need to reload what has already been loaded on another page?
  3. Variant 1 but using etc_cache to store the inserted svgs. Perhaps that retrofits caching to the insert-in-source variant?

One other idea (that I need to check). You can insert svg collections as symbolsets and then use the svg symbols in your pages. I can’t remember precisely, but I have an inkling that you can control some (all?) of the contents via css. The symbolset file is loaded once as an external resource, so is potentially cached by the browser.

etc wrote #340399:

Exactly. So what would be a natural syntax: form="my_form?", maybe?

Of the two, |* or ? I think I prefer the pipe-star.


TXP Builders – finely-crafted code, design and txp

Offline

#19 Today 01:03:21

phiw13
Plugin Author
From: South-Western Japan
Registered: 2004-02-27
Posts: 3,451
Website

Re: How do I suppress a "missing form" error?

jakob wrote #340424:

[…]

  1. The ‘clever’ way with the svg inserted into the source two (sometimes three) times with css variables doing the colour switching.
  2. Saving three preset colour variants of the logo and simply inserting the svgs as images. Presumably, the browser doesn’t need to reload what has already been loaded on another page?
  3. Variant 1 but using etc_cache to store the inserted svgs. Perhaps that retrofits caching to the insert-in-source variant?

One other idea (that I need to check). You can insert svg collections as symbolsets and then use the svg symbols in your pages. I can’t remember precisely, but I have an inkling that you can control some (all?) of the contents via css. The symbolset file is loaded once as an external resource, so is potentially cached by the browser.

That last option (external SVG with <use /> suffers from the same problem as the <img src=""> approach in that you can’t go into the shadowdom – all you can style is the <svg/> itself. This article (dev.to/javar/external-svgs-that-you-can-style-2a37) suggest a possible but limited workaround with fill="currentColor" I haven’t tested.

Depending on the size of the SVG option 2 (use multiple versions loaded as img) is probably the most performant but a little less flexible. Inserting the whole SVG block (minified?) in the html is more flexible. Caching is a bit more of an issue, but gzip works very well on SVG blocks. And as you say, etc_cache might help.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg

Offline

Board footer

Powered by FluxBB