Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: Admin theme customisation
Thank you, Stef. That gives a starting idea on the possibilities.
I’ll try to play a little with this over the WE.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg
Offline
Re: Admin theme customisation
You did it! Looks promising, and makes me question the admin theme role. Our existing themes mostly define css rules and a bit of js to output the hard-coded markup, though they have full php powers. Do they need more flexibility, to be able to define their own presentation? Should core just send them json (say) data and provide some api for read/write requests?
Offline
Re: Admin theme customisation
etc wrote #341388:
You did it! Looks promising, and makes me question the admin theme role.
Precisely. I have actually got (somewhere…) an Admin->Panel class, half finished, which generalises the process of building a back-end screen. That should mesh nicely with this stuff.
If we can get to the point where core has a library of tools, widgets and page building layers that anyone can tap into, the admin theme is basically a collection of these things and some CSS wrapped around data.
We’re definitely on the right track with the UI library, and the Table classes and stuff like that. Theme Prefs adds another string to it, and I’m planning to demo how useful their involvement is in a day or two.
Also, of the panels I’ve converted so far, extending the tables via plugin works (even though it’s not ideal as the core columns always come first). That probably needs rethinking a bit so I might pause where we are and perhaps, as you say, we can retool the way it works as we iterate Txp 5.
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: Admin theme customisation
Okay, it’s only three lines of code so now there’s a helper method in the Theme class to get theme pref values:
$value = $this->get_pref('my_pref_name');
That prepends the name and pipe for you. Much nicer :)
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
#17 Today 01:24:16
Re: Admin theme customisation
just noticed that the new Admin UI (v4.9.0-dev) no longer has the quick GO tab to go to a specific area- -articles, pages, forms, etc. It now is replaced with LOGOUT tab. I do miss it in the new UI…
Don’t know if the older sites had plugin for this function (which I don’t see on my sites), so I thought I would ask here?
This might have been discussed elsewhere but I could not find mention in my search.
…. texted postive
Offline
#18 Today 06:14:16
Re: Admin theme customisation
bici wrote #341496:
just noticed that the new Admin UI (v4.9.0-dev) no longer has the quick GO tab to go to a specific area- -articles, pages, forms, etc. It now is replaced with LOGOUT tab. I do miss it in the new UI…
Don’t know if the older sites had plugin for this function (which I don’t see on my sites), so I thought I would ask here?
This might have been discussed elsewhere but I could not find mention in my search.
You need to use the “Classic” theme for that. Hive, the default admin theme since… since 4.6? does not use that. Go to Admin > Preferences, click on admin in the list and scroll down to select an admin theme
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg
Offline
#19 Today 07:12:49
Re: Admin theme customisation
Thanks. Unfortunate that it could not have been incorporated in Hive. i still use classic on two of my sites and hive on two others. Admittedly i use it infrequently, even though it is at times useful…
…. texted postive
Offline
#20 Today 08:20:55
Re: Admin theme customisation
bici wrote #341496:
just noticed that the new Admin UI (v4.9.0-dev) no longer has the quick GO tab to go to a specific area- -articles, pages, forms, etc. It now is replaced with LOGOUT tab. I do miss it in the new UI…
I vaguely remember there being a plugin for that but can’t recall what it was called.
TXP Builders – finely-crafted code, design and txp
Offline
#21 Today 13:48:38
Re: Admin theme customisation
One thing that may need some thought is l10n/i18n. Using hive as an example, the language strings in the database are currently defined as:
hive|thumb_width
hive|thumb_height
hive|thumb_cropping
hive|instructions_thumb_cropping
...
Although the key names (in this case) need to be hard-wired so the Images panel can pick them up, they all need namespacing in some way to avoid clashes with other strings: in case an admin theme wants to call the same string something different, for clarity.
The textpack itself, if housed inside the admin-theme’s own folder, can omit the namespace prefix hive| because it will be automatically added when the strings are imported by core.
For custom-built admin themes, this doesn’t pose much of an issue because the theme author is responsible for its upkeep and if they provide any translations, they’ll do it in each successive release of their own textpack.txp file.
But for the core themes it’s a different matter. In order for translators to “know” about the new strings we need them in the core’s main lang/textpacks OR we need to somehow extend the reach of CrowdIn so it ‘knows” of the existence of these other textpack files in the different (admin-themes) repos.
Further, if these are somehow brought into CrowdIn centrally, the string keys will need to be namespaced when they’re imported into CrowdIn and then the namespace stripped off when the script to drag the keys down distributes them between the core /lang/textpacks and the core /admin-theme/{themename}/textpack.txp.
There’s a further annoyance that (in the case of these common prefs), the translations are all identical. It’s a bit of a burden for translators to copy n paste them all to each theme. So it’d be grand if we could somehow flag strings as “for a theme” in CrowdIn, and only have one copy up there which. is automagically duplicated and prefixed on export when creating the individual theme textpack.txp files.
Does anybody have any thoughts on how best to manage this?
Last edited by Bloke (Today 13:52:28)
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
#22 Today 13:56:38
Re: Admin theme customisation
Side note: should we enforce a similar admin-theme/{themename}/lang/{lang-id}.ini folder structure for themes, instead of all translations in one theme-root-level textpack.txp file? It seemed overkill, for the few strings that a theme may need, to have multiple files, but I can be swayed.
Last edited by Bloke (Today 13:57:33)
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