Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: How do I suppress a "missing form" error?
I’ve always ended up with svg (as terse as I can make it) in the html — every other approach has had one pitfall or another.
You could try uploading your svgs as individual ‘characters’ in a custom font using icomoon. Tiny font file, cached.
Offline
#26 Today 00:58:55
Re: How do I suppress a "missing form" error?
etc wrote #340429:
I guess we mean the client-side cache here, so
etc_cache
wouldn’t help much. But you can borrow the idea of HTMX or its lightweight alternative HTMZ
- store SVG as ‘external’ file
- include this file via a hidden
iframe
- move the iframe content to the main DOM on load
iframe
being usually loaded as a low(-er)-priority resource, I am not sure this improves the situation all that much (load content of frame, … , wait till Dom is fully loaded, run script to clone and style). If the SVG must be displayed near the top of the page that could cause problems.
Depending on the workflows Julian actually needs, it might be cheaper and faster to just swallow the cost of the SVG block inside the HTML. Bit more bits to download, but the HTML is the first to be parsed and rendered.
Also – how big is the SVG block vs total weight of the page?
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg
Offline
#27 Today 06:35:21
Re: How do I suppress a "missing form" error?
jakob wrote #340424:
The ‘clever’ way with the svg inserted into the source two (sometimes three) times with css variables doing the colour switching.
Thinking out loud, would this be any easier if our SVG were somehow parse()able? Like, I dunno allowing <txp:...>
tags or some sort of {replacement}
inside the SVG body and then passing the replacement values in via <txp:image>
attributes or something?
Not saying this is achievable or possible in a sane way, just asking the question if that sort of approach would solve your initial problem of trying to vary the colours inside the images on the fly.
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
#28 Today 08:49:55
Offline
#29 Today 09:37:53
Re: How do I suppress a "missing form" error?
etc wrote #340449:
True, it only works well when accompanied with some ‘reveal’ effect. Various alternatives (
embed
,script
etc) suffer from the same problem.
For secondary content, or some element that displays further down the page, it could be a neat trick though.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg
Offline
#30 Today 09:57:42
Re: How do I suppress a "missing form" error?
In Chromium-based browsers, JS fetch
seems to work remarkably well (even without priority: "high"
parameter) comparatively to Firefox. Priority seems to be the bottleneck here, dom transforms take just few milliseconds.
phiw13 wrote #340450:
For secondary content, or some element that displays further down the page, it could be a neat trick though.
It’s also nice for updating page parts on user interaction (clicks etc), though I’m not sure the overhead is worth saving few lines of JS code.
Offline