Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-03-20 12:22:00

variaas
Plugin Author
From: Chicago
Registered: 2005-01-16
Posts: 402
Website

Admin Side Theming! (r3149)

In case you missed it: r3149. I just loaded the latest rev and will playing with this all day!

Last edited by variaas (2009-03-20 12:26:14)

Offline

#2 2009-03-20 12:37:57

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

Re: Admin Side Theming! (r3149)

W000000000000000000000000000000000000000000000000t!

You’ll be playing with this all day?! I know someone else who will be if I get half a chance. This is perhaps a ticket to a free ride on the smd_skin express :-) Time to think about updating that plugin to take advantage of this native functionality over the next few weeks. Having themes as a class makes stuff so much easier. And having the manifest information native too is a major bonus.

Way to go, wet, thank you! Happy days, happy days.

Last edited by Bloke (2009-03-20 12:41:13)


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

#3 2009-03-20 12:40:26

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: Admin Side Theming! (r3149)

variaas wrote:

In case you missed it: r3149. I just loaded the latest rev and will playing with this all day!

Yes, I’ve just noticed and it’s a very welcome change. Thanks wet!

Offline

#4 2009-03-20 12:42:53

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

Re: Admin Side Theming! (r3149)

In order to have at least a little bit of fun, you’d better enable the advanced prefs theme switcher:

UPDATE txp_prefs SET html= 'themename' WHERE name = 'theme_name_TODO' 

The switcher is still disabled to aid development. To avoid confusion: Apply the SQL command literally – only adapt to your actual table name!

Offline

#5 2009-03-20 12:44:29

variaas
Plugin Author
From: Chicago
Registered: 2005-01-16
Posts: 402
Website

Re: Admin Side Theming! (r3149)

Yeah – I want to express my thanks to all the TXP core devs! This along with the new pluggable_ui is definitely bringing back my TXP fever!

Offline

#6 2009-03-20 13:02:00

variaas
Plugin Author
From: Chicago
Registered: 2005-01-16
Posts: 402
Website

Re: Admin Side Theming! (r3149)

@wet: is that required? in my test (fresh) install I still have it set to theme_name_TODO and was able to switch styles. I even ported over the “wordpress” style from Desandro, and it works!

FYI – to get some working themes here’s a basic run through and once you get the hang of it you can skip several steps:

1. Create a new directory in textpattern/themes. This directory name will the name of your theme.

2. Inside the new directory create a php file with the same name as the directory.

3. Edit this php file. You can copy over classic.php from textpattern/themes/classic to get the basic structure. Remember to change the class name from classic_theme to _themename__theme. Also, remember to update the manifest information.

4. Now you need some css. So create textpattern.css in your theme’s folder (it doesn’t have to be called textpattern.css, but if you name it something else remember to update themename.php). You can grab a couple different css designs from (http://txpadminthemes.desandro.com/article). The CSS files on Desandro’s site are based off of the classic theme so it works almost perfectly.

5. In the TXP admin interface go to Admin->Preferences->Advanced and select the theme from the dropdown for “theme_name_TODO”.

That’s the quick rundown, and if I missed anything let me know and I’ll update it. I was able to port over the “Wordpress” Admin theme in under 1 minute, so it’s really easy! Check it out:

Offline

#7 2009-03-20 13:06:43

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

Re: Admin Side Theming! (r3149)

variaas wrote:

1. Create a new directory in textpattern/themes. This directory name will the name of your theme.

Correct.

2. Inside the new directory create a php file with the same name as the directory.

Correct.

3. Edit this php file. You can copy over classic.php from textpattern/themes/classic to get the basic structure. Remember to change the class name from classic_theme to _themename__theme. Also, remember to update the manifest information.

Probably not necessary as a whole. Look into ../theme/remora/remora.php for a slimmer way to inherit from the classic theme by using theme::based_on() and overriding only the methods which need different output. The inheritance procedure is still subject to change.

Offline

#8 2009-03-20 13:10:21

variaas
Plugin Author
From: Chicago
Registered: 2005-01-16
Posts: 402
Website

Re: Admin Side Theming! (r3149)

wet wrote:
Probably not necessary as a whole. Look into ../theme/remora/remora.php for a slimmer way to inherit from the classic theme by using theme::based_on() and overriding only the methods which need different output.

That’s true and thanks for pointing that out. I figured for people writing their first theme they should understand all the functions that make up a theme. Moving forward their subsequent themes can take advantage of theme::based_on.

Last edited by variaas (2009-03-20 13:11:03)

Offline

#9 2009-03-20 13:23:48

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

Re: Admin Side Theming! (r3149)

variaas wrote:

I was able to port over the “Wordpress” Admin theme in under 1 minute, so it’s really easy!

Nice!

So if it’s that easy and you can switch styles from the TXP interface itself, maybe there’s no need for smd_skin at all? It only adds a UI to the process so you can:

  • edit/clone themes
  • manage files
  • upload a themenail(!)
  • assign manifest info (affectionately called skinfo in my plugin for now)
  • optionally target a particular SVN rev to indicate a theme won’t work below rXXXX
  • import/export themes as zip packages
  • permit .js files to be included in the theme which (from first glance) the built-in system does not (yet?)
  • allow forced global, per-user or per-group themes (which I’m not sure will actually work now the per-user txp_prefs are around — need to test it)
  • limit users to only being able to switch between an admin-configured list of themes; so installing/editing a theme does not necessarily “release it” to the masses until you deem it is ready
  • (planned) upgrade themes from a central repo and show when compatible themes/updates are available for download

Whaddyall think? Is it worth even bothering to continue the plugin when the dust settles and the feature set becomes more stable?

Last edited by Bloke (2009-03-20 13:25:40)


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

#10 2009-03-20 13:27:48

nemoorange
Plugin Author
From: Washington DC
Registered: 2006-11-29
Posts: 90
Website

Re: Admin Side Theming! (r3149)

Very excited by this announcement! This is a good solution to transistion away from the table-based layout as well.

Just so I understand correctly…From variaas’ explanation, distributing themes would only require uploading the theme folder, then selecting it from the preferences menu. Is that right?

Also, we’ll have to consider the best way to manage admin themes. I’m guessing Textgarden for now?


Txp admin themes | dropshado.ws – a blog for design noobs like me

Offline

#11 2009-03-20 13:29:00

variaas
Plugin Author
From: Chicago
Registered: 2005-01-16
Posts: 402
Website

Re: Admin Side Theming! (r3149)

Whaddyall think? Is it worth even bothering to continue the plugin when the dust settles and the feature set becomes more stable?

I like the idea of editing themes in the TXP admin interface.

Offline

#12 2009-03-20 13:32:10

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

Re: Admin Side Theming! (r3149)

nemoorange wrote:

Just so I understand correctly…From variaas’ explanation, distributing themes would only require uploading the theme folder, then selecting it from the preferences menu. Is that right?

Yep, if that’s how you want to present the interface to all users of the admin-side, that’s it. Magic!

Also, we’ll have to consider the best way to manage admin themes. I’m guessing Textgarden for now?

Stuart has already pledged Textgarden as an available resource and it’s totally the right place for it, imo. It’s primed and ready and we’d discussed the notion of a mechanism (like a feed) to allow TXP or some plugin to be able to check for theme updates.


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