Proposal: child themes
Proposal: child themes
Backwards compatibility has always been a strong suit of s9y, and on some level, I think that's a good thing. But there are some areas in which backwards compatibility will be (or already is) an issue. Since we always cared about not breaking the whole thing for some small feature, we should probably look for workarounds.
"My" area of contribution is frontend templates, which is an area in which s9y is already way behind in my humble opinion:
* We have a default template which is ridiculously outdated, but cannot be changed easily because it's the fallback template. There are quite a number of templates which rely on this theme's .tpl files. (It also includes an admin template which is very frustrating to style because large parts of it are hardcoded, but that's a different subject, I guess.)
* We have a standard template (Bulletproof) which is widely appreciated, still more or less up-to-date in terms of markup and very user-friendly. Unfortunately, it's not a good starting point for template development because the code is, well, not exactly manageable if you're not Don or me.
Of course, one can simply change all the files from /templates/default/ to their liking, but that's not very smart since it's a lot of work to do for every single theme.
Possible solution for this: A concept I stumpled across in that other blog engine -- child themes.
Any theme could have a "parent theme" which it would use as its "personal fallback". That way, some themes could keep the current default as their fallback, templates based on BP could be done just the way the mt-* themes work now (some images and a stylesheet, although I haven't really thought that through), others could use a "new default" etc. It should also not be possible to install a child theme if the parent theme isn't present for some reason. And since there are currently no themes which don't use /templates/default/ as a fallback, /templates/default/ could simply be the "fallback fallback", if that makes any sense.
I have more ideas for themes up my sleeve, but this seems to be the most important one because it would give s9y theme development a whole new perspective. Of course, I have no idea whether this would be easy to implement or could implement it myself. Maybe it's even a stupid idea for some weird reason I haven't thought about.
So what do you (coder) guys think? Garvin?
YL
"My" area of contribution is frontend templates, which is an area in which s9y is already way behind in my humble opinion:
* We have a default template which is ridiculously outdated, but cannot be changed easily because it's the fallback template. There are quite a number of templates which rely on this theme's .tpl files. (It also includes an admin template which is very frustrating to style because large parts of it are hardcoded, but that's a different subject, I guess.)
* We have a standard template (Bulletproof) which is widely appreciated, still more or less up-to-date in terms of markup and very user-friendly. Unfortunately, it's not a good starting point for template development because the code is, well, not exactly manageable if you're not Don or me.
Of course, one can simply change all the files from /templates/default/ to their liking, but that's not very smart since it's a lot of work to do for every single theme.
Possible solution for this: A concept I stumpled across in that other blog engine -- child themes.
Any theme could have a "parent theme" which it would use as its "personal fallback". That way, some themes could keep the current default as their fallback, templates based on BP could be done just the way the mt-* themes work now (some images and a stylesheet, although I haven't really thought that through), others could use a "new default" etc. It should also not be possible to install a child theme if the parent theme isn't present for some reason. And since there are currently no themes which don't use /templates/default/ as a fallback, /templates/default/ could simply be the "fallback fallback", if that makes any sense.
I have more ideas for themes up my sleeve, but this seems to be the most important one because it would give s9y theme development a whole new perspective. Of course, I have no idea whether this would be easy to implement or could implement it myself. Maybe it's even a stupid idea for some weird reason I haven't thought about.
So what do you (coder) guys think? Garvin?
YL
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Proposal: child themes
Hi!
We should actually have this since a long time.
In your info.txt you can specify "engine: default" (default *g*) or "engine: new_default". This should specify the fallback directory. Wanna try it out?
(BTW: Great idea. I also completely forgot about this. This could save us some hassle; simply introduce a "serendipity2" template (or whatever) and use that for engine: in all compatible and new templates.)
Regards,
Garvin
We should actually have this since a long time.
In your info.txt you can specify "engine: default" (default *g*) or "engine: new_default". This should specify the fallback directory. Wanna try it out?
(BTW: Great idea. I also completely forgot about this. This could save us some hassle; simply introduce a "serendipity2" template (or whatever) and use that for engine: in all compatible and new templates.)
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Re: Proposal: child themes
Wait, are you telling me I just typed a proposal for something we already have?!? (I'll give it a try over the weekend and report back.garvinhicking wrote:In your info.txt you can specify "engine: default" (default *g*) or "engine: new_default". This should specify the fallback directory. Wanna try it out?
YL
-
- Regular
- Posts: 3652
- Joined: Mon Feb 13, 2006 2:40 am
- Location: Chicago, IL, USA
- Contact:
Re: Proposal: child themes
I was just thinking: "How much time could Don have saved on Kinetic had he known about this?" ...Don Chambers wrote:Interesting...
YL
Re: Proposal: child themes
I just now created an empty template folder containing only an info.txt with
in the last line. Gives me a blank front page. Hmmm.
YL
Code: Select all
engine: bulletproof
YL
-
- Regular
- Posts: 3652
- Joined: Mon Feb 13, 2006 2:40 am
- Location: Chicago, IL, USA
- Contact:
Re: Proposal: child themes
Probably very little.... but I do like the concept. I have never investigated wp's child concept, but I thought it was closer to the bp concept of user.css.... then again, since it is wp, that means you could have entire php file modifications from one child theme to the next... not just style sheets.yellowled wrote:I was just thinking: "How much time could Don have saved on Kinetic had he known about this?" ...Don Chambers wrote:Interesting...
YL
=Don=
Re: Proposal: child themes
Okay, for anyone willing to test this themselves, here's what I just chatted about with Garvin:yellowled wrote:I just now created an empty template folder containing only an info.txt with
in the last line. Gives me a blank front page. Hmmm.Code: Select all
engine: bulletproof
* You'll want to test this with a recent svn snapshot (1.6alpha2 or later).
* The new template assigned via engine needs all files default has. That includes the treeview and YahooUI stuff etc.
I can't post any result so far since I have to edit a fresh copy of default at the time of writing this
YL
Re: Proposal: child themes
Liftoff, we have a liftoffyellowled wrote:I can't post any result so far since I have to edit a fresh copy of default at the time of writing this
Meaning: It's working. I haven't really played with it yet to the full extent, but it is working.
This is so cool.
YL
-
- Regular
- Posts: 3652
- Joined: Mon Feb 13, 2006 2:40 am
- Location: Chicago, IL, USA
- Contact:
Re: Proposal: child themes
It works for me. I created an empty template folder. I then copied bp's info.txt file to this folder, modifying it as follows:yellowled wrote:I just now created an empty template folder containing only an info.txt with
in the last line. Gives me a blank front page. Hmmm.Code: Select all
engine: bulletproof
YL
Code: Select all
Name: Child Theme Test 1
Author: Don Chambers
Date: 2010-08-21
engine: bulletproof
Require Serendipity: 1.2
Code: Select all
<link rel="stylesheet" type="text/css" href="{$serendipityHTTPPath}templates/{$template}/{$template_option.colorset}_style.css" />
Code: Select all
{if $template_option.colorset}<link rel="stylesheet" type="text/css" href="{$serendipityHTTPPath}templates/{$template}/{$template_option.colorset}_style.css" />{/if}
Code: Select all
<img src="{$serendipityHTTPPath}templates/{$template}/img/bulletproof_button.png" alt="Based on the s9y Bulletproof template framework" width="100" height="28" />
=Don=
Re: Proposal: child themes
Please note that w/ Garvin's latest patch to svn, you could also state:Don Chambers wrote:Code: Select all
Name: Child Theme Test 1 Author: Don Chambers Date: 2010-08-21 engine: bulletproof Require Serendipity: 1.2
Code: Select all
engine: new_default,bulletproof,default
YL
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Proposal: child themes
Hi!
Yes, you can now have multiple (as many as you like) fallbacks quite easily.
Regards,
Garvin
Yes, you can now have multiple (as many as you like) fallbacks quite easily.
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
- Regular
- Posts: 3652
- Joined: Mon Feb 13, 2006 2:40 am
- Location: Chicago, IL, USA
- Contact:
Re: Proposal: child themes
The original default has to be specified? I figured it would fallback to whatever is specified first, and if a file is missing there, would still ultimately fall back to default. No?
=Don=
Re: Proposal: child themes
Again: No. Also again: Please correct me if I'm wrong.Don Chambers wrote:The original default has to be specified? I figured it would fallback to whatever is specified first, and if a file is missing there, would still ultimately fall back to default. No?
Also not necessarily a bad idea. The sweet thing behind this is that you can actually write an engine template which can serve as a default to many child themes but doesn't need to be cluttered with feed tpls, the JS stuff for treeview etc.
Edit: Also, I just noticed that Garvin included those fixes in the 1.5.4 release, so we could start using the engine/child concept as of now. If we were that quick, of course.
YL
-
- Regular
- Posts: 3652
- Joined: Mon Feb 13, 2006 2:40 am
- Location: Chicago, IL, USA
- Contact:
Re: Proposal: child themes
That is my whole point - I would not want to provide duplicate smarty templates if they are identical to /default/yellowled wrote:The sweet thing behind this is that you can actually write an engine template which can serve as a default to many child themes but doesn't need to be cluttered with feed tpls, the JS stuff for treeview etc.
=Don=