Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Offline
Re: Feedback to: Textpattern CMS 4.7.0 beta released
Is there a way to work with themes like you can with oui_flat? I mean editing the flat files and they automatically sync into the database, without copying and pasting in to the backend? If not the case currently, is this on the horizon?
Last edited by CodeWalker (2018-03-16 11:03:04)
Offline
Re: Feedback to: Textpattern CMS 4.7.0 beta released
CodeWalker wrote #309988:
Is there a way to work with themes like you can with oui_flat? I mean editing the flat files and they automatically sync into the database, without copying and pasting in to the backend? If not the case currently, is this on the horizon?
Yes that is something we hope to introduce via a web hook at some point in the future (a URL you specify that acts as a trigger to upload the theme to the database again). At the moment if you work on the flat files you can go to the ‘Themes’ panel, select the checkbox next to the theme you want to reimport and then select ‘Override’ from the actions list. That’ll reimport the theme from flat files (no need to copy/paste at all).
I don’t know why it’s called ‘Override’ and not something more obvious like ‘Reimport’, but I wasn’t involved in developing that feature.
Offline
Re: Feedback to: Textpattern CMS 4.7.0 beta released
philwareham wrote #309989:
Yes that is something we hope to introduce via a web hook at some point in the future (a URL you specify that acts as a trigger to upload the theme to the database again). At the moment if you work on the flat files you can go to the ‘Themes’ panel, select the checkbox next to the theme you want to reimport and then select ‘Override’ from the actions list. That’ll reimport the theme (no need to copy/paste at all).
I don’t know why it’s called ‘Override’ and not something more obvious, but I wasn’t involved in that developing feature.
Smashing, thanks Phil, that will do for now :)
Being able to just edit the flat files in a code editor and have the changes show up on a browser reload without having to do anything was a massive time saver with oui_flat. Would be great if the themes could do that too….
Offline
Re: Feedback to: Textpattern CMS 4.7.0 beta released
@CodeWalker – can you raise an issue on GitHub repo to request that, and then we can track and discuss it. Cheers!
Offline
Re: Feedback to: Textpattern CMS 4.7.0 beta released
philwareham wrote #309989:
I don’t know why it’s called ‘Override’ and not something more obvious like ‘Reimport’, but I wasn’t involved in developing that feature.
It’s been through various permutations: Update, Import, Override as we flip-flopped on ways to handle this.
FWIW, I think I prefer going back to Update. Although it ultimately does the same thing, it’s arguably distinct from Import
, which is the feature in the dropdown at the top of the page if there are any themes in the filesystem that are not in the database. The only annoyance is that ‘update’ is not the direct analog of ‘export’, which is why I (perhaps mistakenly) changed it to ‘import’ originally.
On a related note, I’m still not entirely happy with the ‘Synchronize’ checkbox wording but really can’t think of a universal way of describing what’s going on.
If we went back to ‘Update’ as the multi-edit option name, what makes sense here? From a user perspective, surely the act of ‘updating’ a theme (pulling latest file content form the file system to the DB) is by its very nature ‘synchronizing’ content.
The fact that checking the ‘synchronize’ option blats the DB content first before import and thus makes it an exact mirror with what’s on disk (as far as possible within the confines of the our ‘essential forms/pages/styles’ convention) isn’t immediately obvious. Sure, there’s the pophelps, but I’d love there to be a nicer way to convey this in the checkbox label.
With the checkbox checked, the behaviour is thus [where PFS = Pages/Forms/Style]:
- On update/import/override (whatever we end up calling it) the database PFS are deleted first, then regenerated from disk. The theme metadata is updated from
manifest.json
. - On export, the disk PFS are deleted first, then downloaded from the DB. The
manifest.json
is updated to reflect the theme metadata. - On delete, the database PFS, theme metadata, disk PFS and
manifest.json
are deleted. Any ‘extra’ files (JS, CSS, etc) are not touched, and remain on disk.
With the checkbox cleared, the behaviour is thus:
- On update/import/override, any existing PFS contents in the DB are replaced by what’s pulled from disk. New PFS assets are created if necessary. Old, unused, PFS remain in the database. The theme metadata is updated from
manifest.json
. - On export, any existing PFS files on disk are replaced by what’s downloaded from the database. New PFS files are created if necessary. Old, unused PFS remain on disk. The
manifest.json
is updated to reflect the theme metadata. - On delete, the PFS and metadata are removed from the database only. Their disk counterparts remain. Thus the just-deleted theme becomes available to reimport from the dropdown menu at the top of the Themes panel. Any ‘extra’ files (JS, CSS, etc) are not touched, and remain on disk.
The question is either, a) how do we convey all that in a single, short label, or b) how do we convey that in a series of short labels, one potentially for each action if it makes it clearer.
Although at this stage I’d prefer not to introduce new strings, if this is going to cause massive confusion I’d rather get it right and just have the strings in English for now, then we can do a point release if necessary with the translations as they come through.
Can anyone put their thinking cap on and come up with a solution here? Thanks for any thoughts.
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: Feedback to: Textpattern CMS 4.7.0 beta released
CodeWalker wrote #309990:
Being able to just edit the flat files in a code editor and have the changes show up on a browser reload without having to do anything was a massive time saver with oui_flat.
Yes, but also potentially rather destructive if the theme is in use! Using the development mode (live/testing/debug) as a toggle switch makes things even more complicated, imo.
I don’t trust computers not to lose stuff. I’m one of these habitual CTRL-S guys. Partway through editing a Page, I’d hit CTRL-S to save the file and might suddenly find my site’s broken because it’s automatically syncing and has now got a part-finished doc structure. I’d far rather the sync is manually triggered.
Right now, yes, that trigger is Themes panel -> Checkbox -> Update -> Confirm. Could we introduce a webhook somehow that enabled auto-refresh if you visit some special page? Probably. Dunno how that would work, but if someone wants to enlighten me on how it can be set up, please feel free.
Or how about an ‘Actions’ column in the Themes table that bypasses the multi-click aspect and confirmation? Click the ‘up arrow’ icon in the table row alongside your theme and boom, it gets pulled in. Click the ‘down arrow’ icon in the table row and it gets immediately shoved to disk (or, errr, vice versa – which way do import/export arrows traditionally go?) Whether we do a full sync – forced ‘override’ checkbox (see above) – or we do a merge is something we’d have to consider.
I’m not sure. We want to cater to power users and people who are using it to iterate their designs on live sites, and people who want to import and just try out themes on certain Sections of their site without any impact to their existing site content. So we need to balance this. Right now it’s erring on the ‘casual themer/new user’ territory, with the ability to augment it via plugins for power users.
We could probably do a little more to help smooth the transition from plugin->core themes without impacting the dabblers. Open to suggestions.
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: Feedback to: Textpattern CMS 4.7.0 beta released
Shall we get a beta 2 out now (because we’ve fixed the button spamming issue), then look at if any of what you’ve discuss can be done in time for beta 3?
Offline
Re: Feedback to: Textpattern CMS 4.7.0 beta released
Sure. Just wanna run through a couple of language tests to verify (and potentially fix) what Adi found about plugin strings not coming through, then we can go to beta 2.
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: Feedback to: Textpattern CMS 4.7.0 beta released
FWIW, I think I prefer going back to Update
Yeah, me too.
(on a side note – the French translation is completely bonkers: “Écraser” Which more or less means “smash” in English. “Substituer” would more appropriate, if the current string is kept.)
re. the “synchronise …” string. That actually works fine for me
Last edited by phiw13 (2018-03-16 13:29:38)
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline
Re: Feedback to: Textpattern CMS 4.7.0 beta released
Update++
Edit: but it sounds wrong if the file version is older than the db one…
Offline
Re: Feedback to: Textpattern CMS 4.7.0 beta released
etc wrote #309999:
Update… sounds wrong if the file version is older than the db one…
Yes, that was another concern when we added the multi-edit feature. Perhaps that’s why I went with ‘import’, I dunno.
The original scope (which was waaay too big) was to indicate which side was “fresher” via an icon and/or some color indicators. Gets messy when some assets are fresher on disk compared to the DB, and some are fresher in the DB compared to disk. So we dropped that idea for now.
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