Textpattern CMS support forum

You are not logged in. Register | Login | Help

#21 2018-04-12 13:17:03

etc
Developer
Registered: 2010-11-11
Posts: 2,949
Website

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

Bloke wrote #310912:

Another option is to introduce buttons in each row of the Themes table (in an ‘Actions’ column or something) that will import/export that theme immediately, no prompts, no nothing.

Desirable or not?

If these can be just plain URL links (not a form) then yes. We could then use them in any place on the admin side. I have tried, but some parameters of import/export requests (dunno which) seem to be fetched only from $_POST, not $_GET.


etc_[ query | search | pagination | date | tree | cache ]

Offline

#22 2018-04-12 13:30:55

etc
Developer
Registered: 2010-11-11
Posts: 2,949
Website

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

jakob wrote #310915:

rah_flat / oui_flat syncs them into the db on every page load (as far as I am aware) when you are in testing or debug mode.

That looks a bit risky (easy to loose db edits) and suboptimal (what if nothing is changed?) I would prefer something less automatic, like fetching directly from files in dev mode and syncing once everything is fine. That’s what this plugin does, but it lacks an interface to quickly switch between two modes or sync them.


etc_[ query | search | pagination | date | tree | cache ]

Offline

#23 2018-04-12 14:20:29

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 6,913
Website

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

I am testing this and loving it. I can see the styles, forms and pages being saved but we are yet to have a native way regarding js files. Will it be that hard to include if not on 4.7 on 4.7.1?

Basically, what will be needed is an extra pane under the presentation tab.


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

Online

#24 2018-04-12 14:21:22

jakob
Moderator
From: Germany
Registered: 2005-01-20
Posts: 3,160
Website

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

etc wrote #310919:

That looks a bit risky (easy to loose db edits) and suboptimal …

Sure, it was downright dangerous if you hadn’t exported stuff in the DB. I was just explaining what it did. I think your proposal of swapping to loading from files instead of the DB until such time as one is ready to bring it into the DB is good.

The hook to trigger a sync would still be useful, though.


TXP Builders – finely-crafted code, design and txp

Offline

#25 2018-04-12 15:59:45

etc
Developer
Registered: 2010-11-11
Posts: 2,949
Website

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

jakob wrote #310921:

The hook to trigger a sync would still be useful, though.

Agree, if it can be made secure enough.

colak wrote #310920:

I am testing this and loving it. I can see the styles, forms and pages being saved but we are yet to have a native way regarding js files. Will it be that hard to include if not on 4.7 on 4.7.1?

Basically, what will be needed is an extra pane under the presentation tab.

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.

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.


etc_[ query | search | pagination | date | tree | cache ]

Offline

#26 2018-04-12 16:08:42

philwareham
Core designer
From: Farnham, Surrey, UK
Registered: 2009-06-11
Posts: 3,093
Website

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

I’m of the feeling that a JS panel is best left to a plugin, if you want that editable in core. I personally wouldn’t have included a CSS panel if I was designing Textpattern from scratch – but I can see why people use it.

Online

#27 2018-04-12 16:15:12

etc
Developer
Registered: 2010-11-11
Posts: 2,949
Website

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

philwareham wrote #310927:

I personally wouldn’t have included a CSS panel if I was designing Textpattern from scratch – but I can see why people use it.

Now that it’s there and synced with the filesystem, I would hack it for serving all type of content (CSS, JS, whatever) based, say, on name extension (CSS by default, JS for .js, etc). That’s quite easy to do.


etc_[ query | search | pagination | date | tree | cache ]

Offline

#28 2018-04-12 16:16:06

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

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

etc wrote #310918:

I have tried, but some parameters of import/export requests (dunno which) seem to be fetched only from $_POST, not $_GET.

Shame. Will have to grep the Skin directory and see if we can find ps() and change to gps().

etc wrote #310919:

I would prefer something less automatic, like fetching directly from files in dev mode and syncing once everything is fine.

If that’s possible to factor in cleanly, then great. If not, I’m happy for it to be a plugin as a stop-gap for now until we can think it through for a future release. Probably won’t be 4.7.1, since that’s a patch release (unless we can convince ourselves that this feature “patches” the behaviour of 4.7.0!) In that regard, if we can get something working now prior to 4.7.0 final, we can always tweak it in 4.7.1 as it will then be classed as a patch. Remember we have the option of 4.7.0-rc after beta.3 if we need a week of pre-launch soak testing.

colak wrote #310920:

I am testing this and loving it.

Yay!

but we are yet to have a native way regarding js files. Will it be that hard to include

I’ve always resisted a dedicated JS pane in the admin side, even though it’s not much more tricky conceptually than CSS, for exactly the reason that etc states: it’s very niche. CSS is (arguably because there’s not much else) a fundamental part of how to style a website. JS isn’t, it’s optional.

I’d far rather offer an ability to handle files that contain human-readable text better and let you decide how to serve and interpret them. Then you could use the UI to write and store JSON, text files, javascript, less, SASS, SCSS, whatever, and have their counterparts represented in the theme. EDIT: and I see etc is on the same wavelength, just a minute faster than me at replying!

We’re not there yet. Maybe we never will. But I think restricting ourselves to the one mime type is going to make it harder to offer flexibility in future as we’ll end up marginalising other equally important or valid file formats.

Last edited by Bloke (2018-04-12 16:17:00)


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

#29 2018-04-12 16:22:24

etc
Developer
Registered: 2010-11-11
Posts: 2,949
Website

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

Bloke wrote #310929:

Will have to grep the Skin directory and see if we can find ps() and change to gps().

Good luck, I’ve failed to find the right one.

Probably won’t be 4.7.1, since that’s a patch release (unless we can convince oursleves that this feature “patches” the behaviour of 4.7.0!)

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


etc_[ query | search | pagination | date | tree | cache ]

Offline

#30 2018-04-12 16:22:48

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

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

etc wrote #310928:

Now that it’s there and synced with the filesystem, I would hack it for serving all type of content (CSS, JS, whatever) based, say, on name extension (CSS by default, JS for .js, etc). That’s quite easy to do.

I’m totally with you here.

My original thought, waaaaay back, was a ‘type’ field but using extension is probably cleaner. It means that <txp:css /> needs to only consider the relevant file types. We could keep that tag around for compatibility and convenience, but introduce a new tag that could output “text file stuff” from this table with appropriate mime types; CSS would be one of the supported things we could output, even though it conceptually duplicates the <txp:css> tag, you might want to to output it raw or something, which is something we can’t do now.

What we’d call the panel in the Admin interface is questionable though…

Last edited by Bloke (2018-04-12 16:26:35)


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