Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2009-06-12 22:31:16

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,468
Website GitHub

Re: smd_admin_themes: Manage, edit, switch and share admin-side themes

maverick wrote:

However, the 09 version did not work either once I downloaded it.

Glad the tgz worked, but I just looked at Stuart’s zip file format and figured out why it’s not working. He’s packaged up the files like this:

A Bit Blue
  |--> Instructions.html
  |--> a_bit_blue
       |--> theme files
       |--> ...

The plugin assumes the zip file format starts at the theme’s directory as its top level, i.e. from a_bit_blue downwards. The extra level is confusing it. If you want the zip to upload you’ll have to unpack it to your HD then zip up just the a_bit_blue directory + its contents. That will then upload to the plugin fine.

I can’t find a neat way of ‘just knowing’ (from inside a zip) which directory is the one the theme resides in, which is why I made the rule that the top level dir is the theme dir itself. Stuart’s theme package predates the plugin so he packaged it up himself and added the extra level as help. Incidentally it won’t matter if there are any other files at the top level — they’ll be dutifully uploaded to the theme root dir — as long as the theme’s dir is among the files at the top level of the package.

Last edited by Bloke (2009-06-12 22:31:54)


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

#14 2009-06-14 20:13:17

rsilletti
Moderator
From: Spokane WA
Registered: 2004-04-28
Posts: 707

Re: smd_admin_themes: Manage, edit, switch and share admin-side themes

Yeah, this is excessively cool! any recommends on which theme might be best to study as a tutorial model?

Offline

#15 2009-06-14 20:30:28

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,468
Website GitHub

Re: smd_admin_themes: Manage, edit, switch and share admin-side themes

rsilletti wrote:

this is excessively cool!

Thanks :-)

any recommends on which theme might be best to study as a tutorial model?

  • Remora is good for a “based on” type (simple extension of classic, with a bit of JS funk added)
  • A Bit Blue is good for showing what can be done with a bit more jiggery pokery (tabs as ul/li instead of tr/td), moving stuff around the screen, adding extra links, some greeting text and so on
  • My quick n dirty port of Simple X Bubble for a CSS-only solution

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

#16 2009-06-14 21:21:52

rsilletti
Moderator
From: Spokane WA
Registered: 2004-04-28
Posts: 707

Re: smd_admin_themes: Manage, edit, switch and share admin-side themes

Thanks Steph, Simple_x_Bubble is the first admin theme I’ve seen that I’m tempted to use, the visual enhancement is perfect and the structure that I’m used to remains in place, very nice. Between the three you suggested as tutorials (seems to be pretty much all that’s out there as yet?) there is plenty of insight into how this works to get started.

A little off thread but a new topic doesn’t seem justified. I never was able to resolve the time problems with smd_calendar, ran out of time at the time to get my head all the way around that and the project I was pursuing it for has since gone a bit idle. I did come up with a couple of ideas if you’re curious, I built them so as to plug them into the article context inside the cells, primarily for testing. They are PHP 5 and there may be a better way to do this but they might suggest an idea or two.
class_ts_diff
class_rasTimeDiff

Offline

#17 2009-06-14 21:30:45

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,468
Website GitHub

Re: smd_admin_themes: Manage, edit, switch and share admin-side themes

rsilletti wrote:

Simple_x_Bubble is the first admin theme I’ve seen that I’m tempted to use

Yeah, it’s bloody brilliant. As long as your clients aren’t attached to IE of course, because it uses inline CSS data elements for the nice tabs, which IE6 and 7 don’t support.

the three you suggested as tutorials (seems to be pretty much all that’s out there as yet?)

Ummm, yeah! The competition closing date looms…

I’m no designer or I’d do one myself but nemoorange’s site has a wealth of fab CSS-only themes that are very easy to try by simply creating a New theme from the plugin and pasting his CSS in. Just tweak a few of the url links in the CSS to point to the classic skin and it’s game on. Speaking of which I think I missed one of the images in the simplexbubble port I posted above. Can’t remember if I fixed it or not.

A little off thread <snip>

Thanks for the links. I’ll give the plugins a whirl and see if smd_calendar / the core can benefit. Much obliged.

Last edited by Bloke (2009-06-14 21:31:16)


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

#18 2009-06-15 00:21:02

maverick
Member
From: Southeastern Michigan, USA
Registered: 2005-01-14
Posts: 976
Website

Re: smd_admin_themes: Manage, edit, switch and share admin-side themes

Bloke —

Thanks for the heads up on packaging the themes into a one level directory. Good to know. In my case, it still was the lack of zip support. gzip/tars are fine, but even single level zips failed.

All —-

I don’t want to offend Jon or Dave, but realize that you have to have themes in order to play with the new toy. So, here are my quick and dirty ports of Jon Hick’s and Dave DeSandro’s themes. (Guys, if I’ve overstepped, I’ll gladly pull them down). There may be some bugs yet, but they seem to work well, and were quick to port.

Oh, and a quick suggestion, Bloke. I added a screenshot to your port of Dave’s simple_x_bubble and remora. That now gives me six themes w/ screenshots in the theme manager. And it’s feeling (to me), unwieldy. If you anticipate people keeping multiple themes installed, perhaps have the screenshots as expandable/collapsible might make it more manageable?

fwiw

Mike

Last edited by maverick (2009-06-15 00:30:05)

Offline

#19 2009-06-15 08:15:06

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,468
Website GitHub

Re: smd_admin_themes: Manage, edit, switch and share admin-side themes

maverick

Thanks for the ports. That’s what I did with simplexbubble (and I did forget one of the images, sorry — I’ll try and fix that today). I’m sure when Dave / Jon do their official themes we can pull our versions from our sites and host the proper themes on Textgarden. In the meantime it is fun to experiment with porting themes using the plugin and does highlight some workflow issues such as…

six themes w/ screenshots in the theme manager. And it’s feeling (to me), unwieldy.

Very good point. When I wrote the first version of the plugin last year the thumbnails were limited to 150 × 120px which made it a lot neater on-screen. In wet’s vision of themes he stipulated 260 × 150px (far more usable when viewed standalone) which I used verbatim in the plugin because I’m lazy. Now you mention it, I agree it’s a tad mahoosive in the interface.

How about I add an option in the prefs to allow you to set the thumb dimensions? They’ll be squished by the browser unfortunately — and we all know they make piss-poor attempts at resizing — but if you set either dimension to 0 the thumbs will be turned off.

EDIT: Like this new version with the same version number as before *cough cough* :-)

EDIT2: and I fixed the carver.gif in dds_simplexbubble. zip | tgz

Last edited by Bloke (2009-06-15 08:57:55)


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

#20 2009-06-15 13:12:49

maverick
Member
From: Southeastern Michigan, USA
Registered: 2005-01-14
Posts: 976
Website

Re: smd_admin_themes: Manage, edit, switch and share admin-side themes

I’ll give the new version a go around as soon as I have a chance. It probably won’t be an issue for most sites – they are likely to only have the three themes shipped by default, and one or two added by the user.

I think Wet’s got a good point about the screen shots being large enough to give some sense of what you are choosing, so it appears to UI needs are in conflict.

Tangent:

One other issue I’m having with themes (in general, not the plugin) is when I’m working on a theme and it pulls an error in the php. Up to now I’ve had to manually log into the site and remove the theme from the directory, then refresh the site. With no automatic failover to a “safe” theme” I can see potential for client panic if something goes wrong.

As of today, even after pulling the offending theme out of the directory (a port of aro_marine I’m playing with) I am unable to get back to a working theme. I’ll have to work on it later. Hopefully it won’t be too hard to fix :)

Edit: As much as I hate to suggest it, perhaps admin_themes should act like the plug in tabs, where the themes are disabled in case of emergency?

By the way, this was the error message I got after I removed the non-working theme: “cannot_instantiate_theme: aro_marine, aro_marine_theme, /path to website/textpattern/theme/aro_marine/aro_marine.php”

I went to the plugin tab, and disabled admin_themes, and was able to access the backend again. I think maybe the error above may be related to how the plugin is storing your selected theme?

I notice that:

  • With the offending theme placed back in the theme directory
  • The offending theme still chosen in the plugin (and throwing errors)
  • Then the plugin disabled
  • The backend defaults back to classic

So I’m guessing that the plugin is not changing the actual preference in admin->preferences but setting its own preference that overrides the actual preference?

Then I’m guessing that because of that, the “cannon_instantiate” error when removing the offending theme from the theme director is related to the plugin’s preference?

(Hope that all made sense . . .)

Last edited by maverick (2009-06-15 14:36:41)

Offline

#21 2009-06-15 13:28:59

maverick
Member
From: Southeastern Michigan, USA
Registered: 2005-01-14
Posts: 976
Website

Re: smd_admin_themes: Manage, edit, switch and share admin-side themes

update:

  • Classic is the chosen theme under admin->preferences->advanced
  • Turning the plugin back on continues to throw the “cannot_instantiate” error

So I’m guessing I’ll have to dig into the database and clear the plugin’s preference setting?

Thanks

Mike

Last edited by maverick (2009-06-15 13:29:21)

Offline

#22 2009-06-15 14:49:52

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,468
Website GitHub

Re: smd_admin_themes: Manage, edit, switch and share admin-side themes

maverick

One other issue I’m having with themes (in general, not the plugin) is when I’m working on a theme and it pulls an error in the php.

Yes, TXP bails out. I’ve had that and it’s not very nice. It would, as you say, be good when — if a theme dies for whatever reason — it is just struck from the record until it’s fixed/plays nice again.

No idea if that’s possible. Will give it some thought but I think it would have to be a core feature. It is supposed to failover to classic, but it only does it if there are files missing or something obvious like that. Any syntax errors, or a missing dependency and it’s game over for your admin side.

_“cannot_instantiate_theme: aro_marine, …

Interesting. That happens if the aro_marine.php file is badly formed or missing. From r3209 onwards any attempt to initialize a non-available theme should drop back to classic. If the theme dir is readable but the class definition is somehow mangled you’ll see that error. Perhaps I need to verify the return value and bomb out if it fails; I’m probaby not doing that because I’m a dunce; I’ll check.

Out of interest, how did you remove the theme? Via FTP? Did you get rid of the whole directory or just the contents of the aro_marine folder?

So I’m guessing that the plugin is not changing the actual preference in admin->preferences but setting its own preference that overrides the actual preference?

Yes, sometimes. Because I’m not technically permitted to create a txp_pref called ‘theme_name’ for each user (all vars should be prefaced with my plugin prefix) I’m using smd_skin as a surrogate to keep track of the current theme per user. That is simply read on every page visit. Like a doughnut I’ve missed out the ‘what if the theme is missing’ check from here too. Will fix that, thanks for spotting it. Go into txp_prefs and remove smd_skin for your user (or set to classic) and it’ll return.

I do, however, update TXP’s theme_name under two conditions:

  1. if you delete the theme that is currently designated as global (the asterisked one in the list)
  2. save the admin_theme prefs

I’ll review the policies I’ve chosen and try to make the plugin more robust when themes generate errors. Thanks for your patience. In the meantime, don’t make any mistakes :-p


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

#23 2009-06-15 18:20:29

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: smd_admin_themes: Manage, edit, switch and share admin-side themes

maverick wrote:

With no automatic failover to a “safe” theme” I can see potential for client panic if something goes wrong.

In fact, the core falls back onto the classic theme at certain conditions, e.g. the theme file is not readable, or does not contain a class following the naming convention.

We can add more error handling based on your suggestions. NB: We will handle errrors which might affect theme users – theme developers are knowledgable enough to handle typical under-development errors and would simply overwrite the theme_name prefs in the database in case something goes really belly-up.

Offline

#24 2009-06-15 20:27:41

maverick
Member
From: Southeastern Michigan, USA
Registered: 2005-01-14
Posts: 976
Website

Re: smd_admin_themes: Manage, edit, switch and share admin-side themes

Sorry wet and bloke – I didn’t mean to imply there was no fall back. I knew that in past efforts I could move the offending theme out and fall back to classic.

Here’s the actual process/details. (I’m typing quick — I’ve got another meeting, so hopefully its clear :D )

The actual error that the aro_marine port threw was
“Fatal error: Call to undefined method aro_marine_theme::messenger() in /home/.jabot/maverick/foundtrue.com/textpattern/theme/aro_marine/aro_marine.php on line 56”.

I’m pretty sure I can fix that easily enough when I have time (now watch me have to eat my words :D )

I used ftp to move the aro_marine folder out of the textpattern/theme directory

(actually, I have my “in progress” ports in an folder w/in the theme directory so I can easily move them in and out while working on them; therefore I actually moved it into a sub directory within textpattern/theme)

  • W/ smd_admin_themes disabled, and
  • aro_marine selected using textpattern->admin->preferences->advanced,
  • I received the fatal error above.
  • I move aro_marine back to my in progress folder via ftp
  • I refresh the tab and receive the “cannot_instantiate_theme: aro_marine”
  • I refresh the tab a second time and the theme falls back to classic as it should and has in the past.

The process is same with smd_admin_themes except that the second refresh doesn’t fall back to the classic theme. The “cannot_instantiate_theme:” is the on-going status.

I agree – you don’t have to plan for a fail safe for developers who should know what to do with errors.

Thinking Aloud

My thought is “what if a theme goes bad” and a client cannot ftp in to manually pull the bad theme and allow the fall back to the classic?”

Also, once the offending theme is removed, and they refresh, they initially get another error – “cannot_instantiate_theme:”. I imagine some clients would be in a panic and give up at this point. Would a client think to refresh a second time when they get the “cannot_instantiate_theme:”, so it falls back to the classic theme?

However, perhaps the likelihood of a working theme going bad is too low to worry about it? (possible causes: Corruption of the data? Changes in textpattern or a plugin?)

I did a quick check in the database for smd_skin, but didn’t see it yet. I’ll look when I have more time. And I’ll re-read your posts follow up on anything I missed.

Thanks!

Mike

Last edited by maverick (2009-06-15 20:37:59)

Offline

Board footer

Powered by FluxBB