Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: Testers needed: flat development (4.7+ only)
My high-level plan would be (once the list is shortened):
- all unlisted extensions default to
.css
on both export and output; - the listed ones are exported with their own extension, without
.css
; - the old
css.php?n=test.js
links generated via<txp:css name="test.js" />
still servetext/css
mimetype, for backwards compatibility; - to output
test.js
asapplication/javascript
, link it with somee
parameter:css.php?n=test&e=js
. Note that this will look fortest.js
style in the db; - generate the URL above with
<txp:css name="test" type="js" />
or simply<txp:css name="test.js" type />
.
How’s that?
Offline
Re: Testers needed: flat development (4.7+ only)
etc wrote #310959:
How’s that?
Spiffing. My only reservation is that using the tag <txp:css>
to output a URL to something non-CSS is a little wonky. What would this output:
<txp:css name="test" type="js" format="link" media="print" />
Do we ignore the other attributes for non-CSS files?
Also, when using format="link"
we assume that the output is going to be a <link>
served via css.php
? If you specify format="url"
you get a raw URL spat back. What if you want your .js
to output as a <script>
tag? Seems reasonable. What about SVG (assuming you accept the scripting risks)? Should that render <img src="test.svg" />
if you use format="link"
?
And what if you want to render the contents verbatim, not as a URL but as the actual content? format="raw"
seems useful. Could we accommodate that?
Using the old tag for all this functionality seems fraught with gotchas. Perhaps a new <txp:asset>
tag is cleaner to output anything from the Assets — including CSS — as either a URL processed via css.php
as you outlined above, or raw output. Either way, people will have to construct their own markup around it. And we then leave <txp:css>
to only process CSS (.css
) assets.
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
Re: Testers needed: flat development (4.7+ only)
I wouldn’t try to accommodate all possible formats with all possible attributes. Yes, a new tag seems reasonable, feature set to discuss. Not sure svg
is more risky than js
or xml
, but let’s drop it, who will ever want to edit it? Or not?
Two hours of coding they say…
Offline
Re: Testers needed: flat development (4.7+ only)
Okay, I have submitted the first part. To test:
- create (via Styles) a style called
test.js
withalert('Hello, bloatware!')
inside; - include
<script src="path_to_site/css.php?n=test&e=js"></script>
in some article.
Offline
Re: Testers needed: flat development (4.7+ only)
Cool! And it’s parsable via the Easter egg ;-)
BTW, the enforced .css
extension can be found in Skin/CommonBase.php
and Skin/AssetBase.php
. Search for extension
and you’ll see the paths being constructed by hand in a few places. The default for all asset types is txp
but the Skin/Css.php
class overrides the static $extension
to css
so assets of that type get built like that.
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
Re: Testers needed: flat development (4.7+ only)
Bloke wrote #310965:
Cool!
Cool +1!
And it’s parsable via the Easter egg ;-)
What is that?
etc wrote #310963:
svg
… but let’s drop it, who will ever want to edit it? Or not?
Actually, that is something one sometimes wants to edit, if only to add id, classes or href details to it. One case I’ve had is a map with linked rollover regions.
TXP Builders – finely-crafted code, design and txp
Offline
Re: Testers needed: flat development (4.7+ only)
jakob wrote #310966:
What is [the Easter egg]?
If I told you I’d have to kill you.
set a hidden pref called parse_css
to 1
and you can use <txp:>
tags in your asset content. I know where you live.
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
Re: Testers needed: flat development (4.7+ only)
Thank you gentlemen, will continue tomorrow. And probably change e
for x
(sounds more like extension
).
Lost my Easter egg today, dropping a wrong db when trying to install 4.5.7 :-(
Offline
Re: Testers needed: flat development (4.7+ only)
I know nothing ;-)
TXP Builders – finely-crafted code, design and txp
Offline
Re: Testers needed: flat development (4.7+ only)
Love it!
But… The Styles panel needs to be renamed ;)
Patrick.
Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.
Offline
Re: Testers needed: flat development (4.7+ only)
Pat64 wrote #310970:
Love it!
Me interested too (not immediately for JS/CSS though), but SVG / JSON / …
But… The Styles panel needs to be renamed ;)
Resources ?
Bloke wrote #310967:
If I told you I’d have to kill you.
… copy/paste something into my Notes.app…
Kill me now, you’ll regret it.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline
Re: Testers needed: flat development (4.7+ only)
Bloke wrote #310962:
Spiffing. My only reservation is that using the tag
<txp:css>
to output a URL to something non-CSS is a little wonky.
what about <txp:asset type="js" name="myjs" />
and for css <txp:asset type="css" name="mystyle" media="screen" />
?
On the upgrade installer all styles which are already in existence could be renamed with a .css extension
Do we ignore the other attributes for non-CSS files?
Also, when using
format="link"
we assume that the output is going to be a<link>
served viacss.php
? If you specifyformat="url"
you get a raw URL spat back. What if you want your.js
to output as a<script>
tag? Seems reasonable. What about SVG (assuming you accept the scripting risks)? Should that render<img src="test.svg" />
if you useformat="link"
?And what if you want to render the contents verbatim, not as a URL but as the actual content?
format="raw"
seems useful. Could we accommodate that?Using the old tag for all this functionality seems fraught with gotchas. Perhaps a new
<txp:asset>
tag is cleaner to output anything from the Assets — including CSS — as either a URL processed viacss.php
as you outlined above, or raw output. Either way, people will have to construct their own markup around it. And we then leave<txp:css>
to only process CSS (.css
) assets.
if svgs are included I agree that it is getting more complicated. As such it’s not a big think to contract our own html tags for the assets.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline