Textpattern CMS support forum

You are not logged in. Register | Login | Help

#31 2018-04-12 16:23:27

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,760
Website

Re: Testers needed: flat development (4.7+ only)

etc wrote #310930:

Themes are the main new feature of 4.7, so improving it based on users feedback suits my patch definition.

There, see. You’ve talked me into it :-)


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

#32 2018-04-12 16:30:43

etc
Developer
Registered: 2010-11-11
Posts: 3,297
Website

Re: Testers needed: flat development (4.7+ only)

Actually (Easter egg), you can already enable CSS parsing and set headers with <txp:header />, but then serving flat files could be invalid. We could also introduce some mimetype attribute (guessed from the extension by default) to <txp:css /> (or its successor) for extra flexibility.

Online

#33 2018-04-12 16:31:39

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 7,320
Website

Re: Testers needed: flat development (4.7+ only)

etc wrote #310926:

Agree, if it can be made secure enough.

It’s not very orthodox, but in 4.7 you can create a form called, say, myScript.js, export it to the filesystem and serve from there. The server should then set the appropriate headers based on .js extension.

I tried it. It adds a txp extension after the file name. ie myScript.js.txp

Anyway, I’m not sure we need a pane by mimetype. CSS and JS are the most used ones, but not unique. You might as well want to serve .txt or .html files one day.

I can fully understand what you are saying .json is becoming more and more common.

You did say something here which could actually make sense for future txp versions. That is if the css pane could change so as to support mime types.


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | Respbublika! | NeMe @ github

Offline

#34 2018-04-12 16:34:37

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,760
Website

Re: Testers needed: flat development (4.7+ only)

etc wrote #310933:

Actually (Easter egg), you can already enable CSS parsing and set headers with <txp:header />, but then flat files could be invalid. We could also introduce some mimetype attribute (guessed from the extension by default) to <txp:css /> (or its successor) for extra flexibility.

Absolutely. Right now it formats a very specific type of URL to render a <link> tag or just squirts out the raw URL. Nothing to stop us using this new tag to output either the URL or the raw file contents passed through the auto-detected / overridden mimetype.


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

#35 2018-04-12 16:35:38

etc
Developer
Registered: 2010-11-11
Posts: 3,297
Website

Re: Testers needed: flat development (4.7+ only)

colak wrote #310934:

I tried it. It adds a txp extension after the file name. ie myScript.js.txp

Oops, sorry. Not sure why we need to append .txp extension, though.

Online

#36 2018-04-12 16:36:04

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,760
Website

Re: Testers needed: flat development (4.7+ only)

colak wrote #310934:

if the css pane could change so as to support mime types.

Yes, that’s what we’re talking about now, and I think is the most logical way forward. Just can’t think of a decent name for the panel if it’s no longer just serving Styles.

Last edited by Bloke (2018-04-12 16:39:42)


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

#37 2018-04-12 16:39:20

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,760
Website

Re: Testers needed: flat development (4.7+ only)

etc wrote #310936:

Not sure why we need to append .txp extension, though.

Perhaps we should only append the .txp extension if the name doesn’t already have one? That would depend if the system ignores other files. I think the regex does 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

#38 2018-04-12 16:40:56

etc
Developer
Registered: 2010-11-11
Posts: 3,297
Website

Re: Testers needed: flat development (4.7+ only)

colak wrote #310934:

You did say something here which could actually make sense for future txp versions.

This future could be very near, in fact. Few hours of coding… :-)

Online

#39 2018-04-12 16:45:16

etc
Developer
Registered: 2010-11-11
Posts: 3,297
Website

Re: Testers needed: flat development (4.7+ only)

Bloke wrote #310938:

Perhaps we should only append the .txp extension if the name doesn’t already have one? That would depend if the system ignores other files. I think the regex does that.

If we are going to squat Styles pane (renamed to Assets?), we can leave forms as is, I guess.

Online

#40 2018-04-12 16:50:13

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,760
Website

Re: Testers needed: flat development (4.7+ only)

etc wrote #310939:

This future could be very near, in fact. Few hours of coding… :-)

Tease :-)

do it: you know you want to! that’s what branches are for

etc wrote #310940:

If we are going to squat Styles pane (renamed to Assets?), we can leave forms as is, I guess.

True dat.

EDIT: We’ve referred to Forms, Styles and Pages collectively as Assets in the documentation (only because that’s what they’re called in the code and I copied it). So we’d need to tweak the docs a tad, nothing major.


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

Board footer

Powered by FluxBB