Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: Admin Side Theming! (r3149)
Mmm. Downloaded latest SVN version via Transmit, but I don’t see the theme changer in Admin > Preferences > Advanced? Using MAMP on localhost, don’t know if that has something to do with it..
BTW, what is the preferred SVN URL? I always get problems with the app I use (SCPlugin) and this URL: svn checkout http://textpattern.googlecode.com/svn/development/4.0 dev
Offline
Re: Admin Side Theming! (r3149)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
Re: Admin Side Theming! (r3149)
Finally managed to get “A Bit Blue” working with this. :)
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
Re: Admin Side Theming! (r3149)
When the community wll select site/portal for sharing admin themes?
I hope, admin-theming will add more txp-lovers to our Planet-of-Txp ♥
Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?
Offline
Re: Admin Side Theming! (r3149)
mrdale wrote:
So In layman’s (pixel-pusher) terms, I can use a php file to replace the functions that contain markup in the head library? or could I dynamically replace the entire head library non-destructively?
Yes, you could. Dig into the Remora theme as an instance of how to change the navigation menu’s markup and include custom JS.
Though, in the most simple case when your custom theme involves only styling and custom images, you don’t even need to write a single line of code:
1. Choose a name for your theme. For illustration purposes, I’ll use foobar.
2. Create a new folder: /textpattern/theme/foobar/
3. Create a new file in this folder named foobar.php:
<?php
if (!defined('txpinterface')) die('txpinterface is undefined.');
theme::based_on('classic');
class foobar_theme extends classic_theme{}
?>
4. Create a file named textpattern.css in this folder and apply all your custom styles. You might choose to build your modifications on the ‘classic’ groundwork CSS, or start with a blank file – whatever seems more appropriate:
/*
Foobar Theme for Textpattern CMS
*/
@import url("../classic/textpattern.css");
body{font-size: 7px;}
5. Done.
Offline
Re: Admin Side Theming! (r3149)
Thanks wet!
Actually the Facelift changes the navigation to use a more semantic nested unordered list structure, so in the case it’d require markup to change.
I’ll dig in. check it out.
Offline
Re: Admin Side Theming! (r3149)
Bloke wrote:
Now, I would argue that a plugin is the right place for all this paraphernalia, but in order to work the core would have to check for the existence of a cookie first and try to find that theme — of course, dropping back to global/classic if not found. Once something like this (or an equivalent) is in place,
I elected to make something equivalent which delegates the actual implementation onto the strong shoulders of imaginative plugin authors while the TXP core suffers from a very low overhead for vanilla installs ;-)
You could start like so, and work your way upwards:
if (@txpinterface == 'admin') {
register_callback('foo_theme_name', 'admin_side', 'theme_name');
}
function foo_theme_name($event, $step, $extra='')
{
global $txp_user;
return ($txp_user) ? 'classic' : 'remora';
}
Offline
Re: Admin Side Theming! (r3149)
Bloke wrote:
Yeah, tried that and it affected 0 rows, so it did not work. I don’t see any option for the theme switching in Advanced prefs.
Offline
Re: Admin Side Theming! (r3149)
jstubbs wrote:
I don’t see any option for the theme switching in Advanced prefs.
This is probably the odd case of a SVN checkout being younger than the modify date of the _update_xxx.php script. Try this:
UPDATE txp_prefs SET val= '0' WHERE name = 'dbupdatetime' ;
Offline
Re: Admin Side Theming! (r3149)
Thanks Robert – that query affected one row so it worked, but still not theme drop down select box (assuming that’s what it is).
Offline
Re: Admin Side Theming! (r3149)
Well, then we’d have to beat this stubborn thing into submission:
INSERT into txp_prefs SET prefs_id = 1, name = 'theme_name', val = 'classic', type = '1', event = 'admin', html = 'themename', position = '160';
Offline
Re: Admin Side Theming! (r3149)
wet wrote:
I elected to make something equivalent which delegates the actual implementation onto the strong shoulders of imaginative plugin authors
Sweet as. You da man! I’ll have a play with this at some point, thanks.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
Re: Admin Side Theming! (r3149)
If I accidentally activate a theme that isn’t working properly (i.e. causing a fatal error), is there anyway to revert back to the original theme through TXP? Right now I’m just going into the DB and changing the entry manually. Let me know if I’m missing something.
Offline
Re: Admin Side Theming! (r3149)
Amit – You can delete the offending theme files then do a refresh which should bring back the Classic theme. Then re-upload your theme files and start again.
Last edited by thebombsite (2009-03-23 14:54:03)
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
Re: Admin Side Theming! (r3149)
wet wrote:
INSERT into txp_prefs SET prefs_id = 1, name = 'theme_name', val = 'classic', type = '1', event = 'admin', html = 'themename', position = '160';
Thanks for the SQL. I entered it and now see a text option for the theme:
theme_name classic
Its not a drop down box. Should be, correct?
Offline