RFE Proposal for Easily Redistributable, Powerful Themes

CSpotkill

Joined: 2004-12-11
Posts: 113
Posted: Fri, 2004-12-17 16:22

I spent a bit longer on it, even though I could have posted it yesterday, to make sure I hadn't overlooked anything and to minimize changes to existing Modules. As it stands now, I like it from a Theme/UI perspective. My only concerns are with the multilingual features and how one might go about overriding or replacing existing text.

RFE Proposal for Easily Redistributable, Powerful Themes
By Louis St-Amour (aka CSpotkill)

With the current Gallery 2 design, Layouts are for the XHTML customizations and Themes are mostly for CSS changes. While Layouts are quite powerful, it is extremely hard to write a Theme with one single CSS file for the five (or more) completely different Layouts we currently have — because the CSS, while separate, is also tightly integrated with what is currently on the page. Writing CSS is much easier when you know what XHTML you’ll be working with.

To that end, I propose that Themes should be responsible for both the CSS and XHTML of Layouts, if the theme designer wants to completely customize them. I don’t want to scare designers away from Gallery 2 by suggesting a complex system. Instead, I propose the addition of a simple folder (named “Themed Layouts

AttachmentSize
ThemeRFE.zip15.52 KB
 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Fri, 2004-12-17 19:47

"Great, we talked about it yesterday in the meeting. I'll look it over and reply tonight."

:-)

Actually, my queue is pretty deep right now and I'm going out drinking tonight after work, so I probably won't be able to review it in depth until tomorrow, but I'll look it over and get back to you.

 
jmullan
jmullan's picture

Joined: 2002-07-28
Posts: 974
Posted: Fri, 2004-12-17 19:58

By "after work" bharat means "at my desk."

 
CSpotkill

Joined: 2004-12-11
Posts: 113
Posted: Fri, 2004-12-17 19:58

Hahaha. Thanks, bharat. And for those who missed it, in IRC I was complaining about the lack of response, even though three people downloaded it.

jmullan: how long ago did you upload it?
CSpotkill: Three hours? lol

jmullan: how long did you work on writing it?
CSpotkill: At least an hour, after brainstorming all through yesterday ...
I could probably edit it again and clean it up, maybe add a photo or two, and some UI ideas, but I'll wait a little for comments

jmullan: wouldn't you want us to spend at least an hour reading and thinking before we respond?
CSpotkill: that's the easy excuse :p

CSpotkill: jmullan, I think part of it was I expected people to reply after they downloaded it, even if it was just something like "Great, we talked about it yesterday in the meeting. I'll look it over and reply tonight." I mean, that's how things seem to go on other forums I've been at. Lots of little "status updates" and such.

CSpotkill: Part of it is also nervousness. I want to be doing *stuff* but I can't. I need to see how the new theme system will go, before I can really start re-doing the existing theme, because perhaps the theme structure itself might change (or have to change)

Signe: You put too much stock in people reading the forums. :p
CSpotkill: lol I know.

 
Gaile

Joined: 2002-07-20
Posts: 1301
Posted: Fri, 2004-12-17 20:00
bharat wrote:
"Great, we talked about it yesterday in the meeting. I'll look it over and reply tonight."

:-)

Actually, my queue is pretty deep right now and I'm going out drinking tonight after work, so I probably won't be able to review it in depth until tomorrow, but I'll look it over and get back to you.

I always found it was easier to get thru a deep queue after a night of drinking... :wink:

Bharat - I haven't been around much lately, just wanted to say how great G2 is looking!

Gaile

 
Gaile

Joined: 2002-07-20
Posts: 1301
Posted: Fri, 2004-12-17 20:12

Louis St-Amour (aka CSpotkill)

I downloaded and read your proposal. Although I've certainly not dug deeply into G2 (yet), I've pretty much ripped apart and rebuilt several versions of G1 over the last 2 years to make it look the way I wanted. The G2 carrot (for me) was that it would be far easier to customize, and that customizations would hold over from one version to the next (unlike G1).

Just wanted to say I like your ideas. I think it's important at some point to make sure that a non-designer will be able to easily add their own personalized touches to their G2 gallery without having to wade through a ton of tech info. Making things easier for Jane and Joe Average will significantly improve G2's success rate with the masses.

(and isn't that what we'd like to see)?

Gaile

 
CSpotkill

Joined: 2004-12-11
Posts: 113
Posted: Fri, 2004-12-17 20:34
PixelPoet wrote:
Just wanted to say I like your ideas. I think it's important at some point to make sure that a non-designer will be able to easily add their own personalized touches to their G2 gallery without having to wade through a ton of tech info. Making things easier for Jane and Joe Average will significantly improve G2's success rate with the masses.

(and isn't that what we'd like to see)?

Thanks, Gaile. I just started with G2 a few days ago. It's definitely got potential. :)

I was hoping for that, and as I mentioned near the end, part of the goal is to not only let people figuratively tear G2 themes apart and re-write them, but to also let users customize G2 to make it "perfect", with drag-and-drop ease.

Besides, what's easy for non-technical people should (if done properly) help designers/developers save time, by not having to build everything from scratch, every time.

So, "PixelPoet" (Nice name), are you going to stick around a bit and help out now? (I have to work on the Matrix theme a bit, then I want to start sketching out a new one) Or just check in occasionally, and maybe make a theme or two when things are more stable? ;)

Fancy meeting a fellow Canadian here ;)

 
lvthunder

Joined: 2003-09-12
Posts: 808
Posted: Fri, 2004-12-17 20:44

I don't get the advantages of making a Themed Layout as apposed to either creating a new layout or using the .local files.

When I created my custom layout and theme I made them go together. Since I'm the only admin on my site (I'm not sure how many sites would have more then one admin) I just set the layout, theme, and imageframe to what I want. Since the users can't change to any of the other themes I don't really see the problem with how it is now.

 
Gaile

Joined: 2002-07-20
Posts: 1301
Posted: Fri, 2004-12-17 20:51
CSpotkill wrote:
So, "PixelPoet" (Nice name), are you going to stick around a bit and help out now? (I have to work on the Matrix theme a bit, then I want to start sketching out a new one) Or just check in occasionally, and maybe make a theme or two when things are more stable? ;)

I don't think I have the skills (or energy at this point) to work on G2. When things are more stable I will most likely play around with some themes. Ironically I first signed on with "PixelPoet" as a joke, since I didn't think I'd spend much time here. Now I have to live with it! :roll:

CSpotkill wrote:
Fancy meeting a fellow Canadian here ;)

Yep...fancy that. How's the weather back east? It's a balmy 10C here, with heavy fog in the valley (I'm about 35 minutes east of Vancouver).

btw - I find "CSpotkill" to be rather amusing, since I'm old enough to remember the Dick and Jane books of the 60's with "See Spot run. Run Spot run." Watching him do something other than run would have held my attention longer, but might have done damage to all the other young impressionable minds in the classroom. :)

Gaile

 
CSpotkill

Joined: 2004-12-11
Posts: 113
Posted: Fri, 2004-12-17 21:27
lvthunder wrote:
I don't get the advantages of making a Themed Layout as apposed to either creating a new layout or using the .local files.

When I created my custom layout and theme I made them go together. Since I'm the only admin on my site (I'm not sure how many sites would have more then one admin) I just set the layout, theme, and imageframe to what I want. Since the users can't change to any of the other themes I don't really see the problem with how it is now.

With Themed Layouts, you can continue doing what you're already doing - it won't change that. It just means that people making themes for others can redistribute the themes with multiple "Supported Themed Layouts".

Another part of it personalization options, as you mentioned, so users can choose themes or views, or even for site admins - so they can set different views for subalbums, and use the same theme in both.

It's about making things more powerful and flexible, but also to minimize the amount of "clutter" involved with modifying code to "make it look right" on your site, and organize things to make it easier to maintain the changes.

At least, that's the theory.

PixelPoet wrote:
Yep...fancy that. How's the weather back east? It's a balmy 10C here, with heavy fog in the valley (I'm about 35 minutes east of Vancouver).

btw - I find "CSpotkill" to be rather amusing, since I'm old enough to remember the Dick and Jane books of the 60's with "See Spot run. Run Spot run." Watching him do something other than run would have held my attention longer, but might have done damage to all the other young impressionable minds in the classroom. :)

Snow. And more snow. -3 right now. It'll be -10 tonight. :(

Still, snow's fun. :)

And as for the name, it's actually an online gaming alias. It works well, quite memorable, though for awhile, the kids I was playing with would think of that movie from ... two years ago, I think. You know, "See Spot Run". It was a romance, didn't pay much attention to it.

I don't actually like violence outside of video games, so ... I'm rather embarrassed to have used it here, really. I just wanted a name to sign on with, temporarily, like you. ;)

 
lvthunder

Joined: 2003-09-12
Posts: 808
Posted: Fri, 2004-12-17 22:08

If you don't like your username just sign up again with one you like :wink:

 
CSpotkill

Joined: 2004-12-11
Posts: 113
Posted: Fri, 2004-12-17 22:34
lvthunder wrote:
If you don't like your username just sign up again with one you like :wink:

Nah, it's not that, though bharat even offered to change the name in IRC. I'll stick with it for now, because I can't think of anything better ;)

And I don't really mind the mystique it adds ;)

Besides, video gaming is the tech industry's little secret. I bet we'd all be working 10x more without it ;)

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Sat, 2004-12-18 04:26

Fundamental ideas:
1. Allow the theme to override the layout/module template files
2. Allow the theme to track the the module and layout versions so that it only overrides specific versions of templates.
3. Rename "Layout" to the more intuitive "View"

Thoughts:
I like the concept of allowing the theme to totally override everything that's on the page. This is how it should be, and if we do it right, I think we can make the themes *way* more powerful than they are now. This is a great idea, and we will definitely move forward with it. There are going to be some issues with it (large and small), but on the whole I think that it will fit in pretty neatly.

Questions/Issues:
1. Should a theme be able to work with many different versions of a module and layout? How about different versions of a template file within the same version of a module? This is tricky because we oftentimes change a template without bumping the module version, since bumping the module version is heavy (requires us to perform an upgrade). We typically only do that if we change the database schema. We may want to track an extra "build number" for a module/layout to help us to differentiate, but that may cause a lot of churn for the theme developer, since they will now be tracking based on a single version even though the change may only affect one template out of many in a module. Perhaps instead we should allow the theme developer to track against the CVS version of any given template. Ie, maybe we provide a list saying "this template can override versions 1.1-1.5 of albumBody.tpl". This exposes our CVS version numbers a little further than we have in the past, but it does provide us with a free and easy way to get a unique id for all templates. We can probably work some magic to get our special Smarty resource to figure out the version of the file we're loading and delegate to the theme if it's appropriate.

2. I like your thought about renaming "Layouts" to be called "View" but unfortunately we can't do that because we are using the term View extensively as part of the Model-View-Controller pattern which is pretty integral to G2. I understand that we could call them "Views" as a marketing term, but I fear that it might get confusing ("Which type of view did you mean, again?"). Maybe we can come up with a different name for them? I originally called them Layouts because I was thinking about them as being a way that you could shuffle around the different photos on the page (ie, lay them out, like you would with publishing software).

3. Your proposal address what happens in the case where a theme overrides a module or layout's template file. However, it's unclear to me what happens in the case where a theme doesn't do any overriding. Will we continue to use our existing CSS schema as the API to allow our theme to control the look and feel of our templates? This is the approach that we were taking in the past and we know that on its own, it was too difficult to exert the fine grain control that we really wanted. I think that it forms a good basic layer, though and the overrides will get us the remaining 20% of the way there. But, I think that we need to take a good look at the CSS schema and make sure that it is as efficient as possible.

4. This will require theme developers to have to basically know everything about every module and layout. Originally, I felt that this kind of thing would block theme developers from getting going, so I tried to make a system that was a little more powerful and technical and less labor intensive. But now having had some experience with theme designers it seems like they're not so worried about the laborious part of it and are willing to put the time into it if they can get the control that they want. Does that seem reasonable?

 
CSpotkill

Joined: 2004-12-11
Posts: 113
Posted: Sat, 2004-12-18 05:11

[Responding to Bharat. Skipping the quote, it would take too long.]

Theme versions - In a perfect world, the theme should work only with versions of a module in which the overridden files are not changed. Since we are assuming modules will need to be released to be downloaded by site admins and applied as updates, version increments should be possible, for all the "builds" available to download, if nothing else.

We can't confuse people with different versions of 0.82. If that means adding a build number (0.82.14) then we should. Using CVS would be too risky, and we can't assume everyone will be using CVS. What about Subversion, which doesn't version individual files with version numbers, but instead relies on giving versions to whole checkout/checkins (as I understand it).

Now, back to the themes. I doubt, once things are settled, that version numbers will change *that* quickly for most modules that would need to be overridden. But to help reduce the pressure on site admins (and theme writers who use these advanced features), we should double-check if overridden files *specifically* have been changed. If they haven't been changed, then ignore the upgrade when users visit the site, continue to use the themed override, and alert administrators with a "warning" instead of an "error". If the files have been changed, then we use the new versions.

Some of this could be avoided, however, if during module installation or activation, we check to see if there are any themes overriding files in this module, and see if they are up to date or not. If they aren't, we alert the administrator, and give the option of disabling the override, or avoiding the module upgrade/installation until they update the theme. Same with themes (ask if they wish to disable the override).

Another possibility, down the road, is to integrate some kind of diff with the logic, and attempt to merge the changes into the override files. (This would be my preferred option, and make it much easier for theme writers, especially if the theme is local, and not released elsewhere, or if Site Admins have even a basic understanding of web technologies.)

And, of course, a related option is to check for updates. I'm saving this proposal for another RFE, however, so I won't go in to too much detail here. However, we could also lookup theme updates when outdated overrides are encountered. If we've dedicated theme designers, this feature should be quite useful, especially if combined with an automatic diff/merge.

Renaming "Layouts" to "Views" - How about "Album Views"? Though I still prefer "Views". Hmm. The problem, at least from a designer's perspective, is that "Layouts" are very ... vague. It would be easy to mistake a Layout for a Theme, if you aren't used to how modular G2 is. Why I like Views, is that it's an established term for changing the way a list of files/objects are displayed, as used in many operating systems. For example:

Quote:
One of the most requested new features now in place is spring-loaded folders, which works in all three Finder views — Icon, List and Column. When you hold an item over a folder instead of dropping it in immediately, a window will zoom open beneath your cursor to reveal the contents within.

Source: Apple - Mac OS X - Feature - Finder

Quote:
Speaking of DLLs, another particular shell registry setting you may have noticed in Figure 3 is TileInfo. This refers to a new, Windows XP-specific view mode called Tiles. Tiles mode works side by side with other popular views in Windows such as thumbnails, details, and large. The TileInfo registry entry defines the format that displayed information should have when the file name is rendered in tiling mode in a folder view. TileInfo follows the same syntax rules as InfoTip.

Source: New Graphical Interface: Enhance Your Programs with New Windows XP Shell Features -- MSDN Magazine, November 2001

Quote:
The way that Konqueror displays the files and folders depends mainly on your choice of View Mode. This can be selected from the View->View Mode sub menu ... [Includes: Icon View, MultiColumn View, Detailed List View, Text View, Tree View, Info List View]

Source: View Modes

Quote:
The file manager includes views that enable you to show the contents of your folders in different ways. For example, you can show the contents of a folder in the following types of view:

* Icon view: Shows the items in the folder as icons.
* List view: Shows the items in the folder as a list.

Source: Modifying the Appearance of Files and Folders

So as you can see, everybody calls them "Views". It just make sense to use the word "View", somehow.

Themes without overrides - As I mentioned, it would be an optional new feature. Without it, we stick to the current CSS methods, using CSS as much as possible to override the default presentation of Modules/Views.

Require designers to know everything? - Well, once they pick up how to use Smarty, they'll begin to grasp the rest. They don't actually have to know how the module works, they just need to know where the HTML is and how they can change it. After all, they should be used to HTML ;)

Besides, this is an optional feature, for "power users" only. And if people prefer to use .local, more power to them. In fact, I encourage it - but only for changes that will not be (or would be useless to be) redistributed. (Such as making site-specific changes, like adding in a site name or experimenting)

 
CSpotkill

Joined: 2004-12-11
Posts: 113
Posted: Sat, 2004-12-18 20:48
Quote:
01:48 <+bharat> I think you'd have a better perspective on some of this if you knew more of the codebase
01:48 < CSpotkill> I probably would. LoL. I looked through one of the modules ... but I haven't dared to touch the core module yet.
01:50 < CSpotkill> I know a fair bit about Smarty Templates and CSS ... and I know the basics for PHP ... though I really haven't done enough OOP programming in PHP - I understand OOP though. Well. Almost. I'm still working on patterns. But I've got the basics. So ... I think I can learn more about G2, I just haven't yet ... lol.
01:50 < CSpotkill> Damn, I'm tired. I can't even write a full thought down in one sentence.
01:52 <+bharat> I'll reply in detail in the forums (but not tonight) 01:53 <+bharat> there are a couple of things, though. It's quick and cheap to check the version numbers for files. it's very expensive to do a diff. Remember that each page view can be composed of many different template files
01:53 < CSpotkill> Well, yeah. What I was thinking was to do it only once, on request ... when the problem crops up during the installation of the module/theme
01:53 <+bharat> hmm
01:53 < CSpotkill> or in the admin site after an update or something 01:54 <+bharat> how would that work?
01:54 * bharat thinks it through
01:54 < CSpotkill> well, it would be another option
01:54 < CSpotkill> * Turn off theme override
01:54 < CSpotkill> * Try to fix theme override (do diff) ...
01:54 <+bharat> you have theme X that overrides module M's template T1 and T2, but doesn't touch T3
01:54 <+bharat> you update M, which gives you T1' and T3'
01:54 <+bharat> at that point, should we check every theme to see if they will still work?
01:55 < CSpotkill> Yes, we should check every theme that overrides the module to see if they override either file.
01:55 <+bharat> and if they don't, should we disable the theme?
01:55 < CSpotkill> No, we shouldn't disable the theme entirely, just disable the override
01:55 <+bharat> should the theme have a list of overrides that are active?
01:55 < CSpotkill> exactly
01:55 <+bharat> ok, so on the Site Admin page you have a page for module X
01:55 <+bharat> and it lists 50 overrides
01:56 <+bharat> some of them are in effect, some of them aren't
01:56 < CSpotkill> well, you would hope they all would be
01:56 < CSpotkill> otherwise the theme might not be as intended
01:56 <+bharat> sure
01:56 <+bharat> ok, that makes sense to me. sounds reasonable
01:56 <+bharat> I think that version numbers will still cover it, though. 01:56 < CSpotkill> yeah, I think so too
01:56 <+bharat> the only time that a version number will change is if there's a difference in the file
01:57 < CSpotkill> I'm just trying to make it easier for updates, if there's a way to merge the two without having to re-version, it would make things a lot easier on theme-makers
01:57 <+bharat> the only time that the override won't work is if we change the data that we send to the template
01:57 <+bharat> I agree -- it sounds like a good idea
01:57 < CSpotkill> I still want them to version and release a new theme to update everything "officially"
01:57 < CSpotkill> but until then, if things can be done automatically, I'd prefer it, to encourage people to use this system
01:57 <+fryfrog> CSpotkill: i just read your post
01:57 <+fryfrog> CSpotkill: maybe someone has mentioned it already, but "cvs versions" are present in all gallery files even if cvs wasn't used to get them
01:57 < CSpotkill> I know, fry ...
01:57 <+fryfrog> CSpotkill: because the developers use cvs to create the release
01:58 <+fryfrog> ah, okay
01:58 < CSpotkill> but what if third-party devs create themes or modules ?
01:58 < CSpotkill> and don't use CVS?
01:58 <+fryfrog> ahh, i see what you mean
01:58 <+bharat> theoretically, instead of tracking the version numbers, we could create a system where you put a block at the top of the template that says what variables it's expecting
01:58 <+bharat> doesn't matter -- we can still embed the version number in the .tpl that we distribute
01:58 <+fryfrog> thats a valid point :)
01:58 <+bharat> it can be done automatically (it is already, in fact -- it's just not in a variable that you can access yet)
01:58 < CSpotkill> We *could* but why bother? It would confuse people anyway and needlessly complicate the system
01:58 <+bharat> it would help us considerably
01:59 < CSpotkill> Having seperate "release numbers" or "build numbers" makes more sense ... perhaps for official modules the CVS numbers = build numbers
01:59 <+bharat> because if you make a cosmetic change to the template but don't change its inputs, then the override is still valid
01:59 < CSpotkill> oh .. hmm
01:59 <+bharat> I agree that it may be more difficult to understand, but it would radically reduce the amount of theme churn
01:59 < CSpotkill> yeah, that might do it.
01:59 < CSpotkill> I'm not *quite* sure what it would look like in a smarty template ...
01:59 <+bharat> and also, it's not such a terrible idea to put a block at the top saying "here are what variables are available for you to use"
01:59 <+bharat> I could see how theme developers could really use that info
02:00 <+bharat> (and furthermore, with a little crafty PHP code, I could write something to autogenerate most of it for us)
02:00 < CSpotkill> but if it's easy enough to work with, then yes, it could simplify total "from scratch" redesigns and help separate the presentation markup from the variables and code
02:00 < CSpotkill> lol great, sounds like fun.
02:00 <+bharat> ok. you may have to remind me of that in the morning when I'm sober
02:00 <+bharat> but this has the makings of something pretty good, I think
02:00 < CSpotkill> Why not copy and paste it into the thread? lol
02:00 <+bharat> too lazy.
02:00 <+bharat> plus, drunk
02:01 < CSpotkill> Yeah, I thnk it's the start of something good. :) Fine, don't worry, I'll do it.
02:01 <+bharat> I think a couple more rounds of discussion in the forums will do it
02:01 < CSpotkill> Yeah. And I want to work out localization
02:01 < CSpotkill> it's still bugging me
02:01 <+bharat> what's wrong with it?
02:01 < CSpotkill> I don't know how people should override text ... and redistribute translations, if necessary ...
02:01 <+bharat> too bad about the View thing. It would be a fantastic pain in the ass to change Layouts -> Views now.
02:01 < CSpotkill> Well ...
02:02 < CSpotkill> I don't see why we can't simply refer to it in the interface as "Views" but use Layouts everywhere else :p 02:02 <+bharat> yes. we can definitely do that
02:02 < CSpotkill> If we make it obvious enough that no, layouts = views and it's just a term
02:03 < CSpotkill> no one should have any problems.
02:03 <+bharat> it will be confusing, though. but maybe it'll be worth it
02:03 < CSpotkill> well I don't think so
02:03 <+bharat> oh come on
02:03 < CSpotkill> because people will at least understand the purpose of layouts
02:03 <+bharat> you know it will cause *some* confusion
02:04 <+bharat> two of our primary concepts will have the same name!
02:04 < CSpotkill> I'm thinking that if anyone even knows about the MVC model, they'll associate it as "MVC" and not seperately. And if we make it clear that Views are actually called "Layouts" in the code, it's work-able ...
02:04 < CSpotkill> We could even keep the "Layouts" folder name, to help associate things ... I don't know. Maybe it is strange.
02:04 < CSpotkill> It's just bugging me ...
02:05 < CSpotkill> How about AlbumViews or ...
02:05 < CSpotkill> how about GalleryViews
02:05 < CSpotkill> Or ... soemthing, extra added to it lol
02:06 < CSpotkill> It's just that Views on its own is so much ... easier ... for people to understand
02:06 < CSpotkill> and the majority of users would never see the code
02:06 <+bharat> I don't disagree
02:06 <+bharat> we'll figure something out
02:06 < CSpotkill> the main problem would be for module devs
02:06 < CSpotkill> which I would assume would have to learn MVC together as one
02:06 < CSpotkill> and therefore would already know the difference
02:07 < CSpotkill> The only problem I can think of is if someone reports an error
02:07 < CSpotkill> and thinks its with a Layout, when its actually with an MVC thingy.

Source: #gallery 20041218.log

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Sun, 2004-12-19 00:15

Let's table the "Rename Layouts to View" idea for a second -- I think it's something that we should resolve, but it's a separate issue.

From our discussions, here are the salient points of the proposal.

* Themes have their own configuration page where they have a list of active/inactive overrides. I envision this as a list of modules and template files and an indicator that says that the override is active/inactive/incompatible. Users can toggle the status between active and inactive, but can't change it if it's marked incompatible.
* When we install a new module, we'll scan all the template files and update the overrides for all themes (basically leaving them alone unless they're incompatible in which case we'll mark them as incompatible).
* When we mark an override as incompatible, we'll notify the site admin. We can do this *before* we do the install process, so that the admin can abort the process (but then they'll have to revert to the older form of the module).
* We'll include a new definition block at the top of every template that will give us a list of all the variables used by the template, and what they do. This will help template designers (because it'll give them an idea of what all is available). It'll also provide our template compatibility checking code with a way of knowing whether the change to the template was cosmetic, or actually affects the structure of the template. This will save us a lot of churn in the themes because if you just change a little HTML in a template, the override will remain valid. Downsides: creation/maintenance of these definitions will take time, parsing them for compatibility will take time. (Alternative proposal: we require that every template create its own very simple API version number in a Smarty comment at the top of the file, and only change that version when the template input data changes).
* Override compatibility will be determined by our definition block. Might be easiest to just say that the override is valid if the definition block matches byte-for-byte (that'll save us having to do complex parsing, etc). We'll still want to have a pretty strict format for them (and maybe a unit test that audits templates to make sure that they have the block and that it's well-formed).
* When we include a template or a CSS file, we'll check to see if the current theme has an active override for the given template. If it does, we'll use the version from the theme instead.
* In the absence of an override, we look for a .tpl.local file and use that as an override.
* In the absence of any overrides, we use the existing module/layout's template file and apply our regular CSS rules (as we have now)

Open Issues:
* What happens if the override provides new text? We'll have to provide a localization framework for the theme in that case (ouch!). I vote we punt on this for now and worry about it later.
* A theme that provides a complete makeover of G2 would require the themer to tinker with 150+ templates and 10? CSS files. And that's just the modules we know about!

Let's let this simmer for a day or two, and if no new ideas fall out of it then let's move forward with it.

 
CSpotkill

Joined: 2004-12-11
Posts: 113
Posted: Mon, 2004-12-20 02:50

As a test for the new wiki I installed on my site, I added my RFE Proposal for Easily Redistributable, Powerful Themes. I've also added all the relevant comments to the "Discussion" for the article, Talk:RFE Proposal for Easily Redistributable, Powerful Themes.

Since it's a wiki, feel free to edit anything and insert your own comments, improvements or examples. I think I'll try editing in all we discussed and summarize the changes at the top, later tonight or tomorrow.

I plan on using the wiki to collect UI design ideas for Gallery 2 and use it to share and develop whatever documents I might otherwise work on through a series of forum posts. Wikis not only make it easier for me to edit and make changes, but lets everyone contribute their ideas or ask questions, right there in the page.

Here are My thoughts on the open issues Bharat posted:

I18N / L12N

While I'm afraid I'm stating the obvious, this is my number one concern with the new concept. If a designer can't change text without thinking, it may severly reduce the usefulness of this new technique for specialized themes or adapting the gallery's tone to fit an existing site or corporate specification.

Perhaps customizations should be done through some kind of redistributable language-variation, like EN-CA (Paintings) or EN-US (Google Inc.).

Override Complexity

Well, again, I would expect that theme designers would start with global changes, and override a few standard design-related Modules, such as ImageFrame or ImageBlock if they need to, to fit their site. Instead of learning what every module does, I think designers would prefer to View Source in their browser, pick out what they want to change, and use Find in Files to search for related HTML code, and pick out where it is stored. Then it's a simple case of setting up the folder structure/module.ini for the Module and copy over the file to be changed. For updates, using a diff style program combined with the information about the variables (hopefully provided by the developers) should make it easy enough to maintain even 40-50 module overrides, assuming most don't change more than once every month or two. And again, all the overrides and such are (and should be) completely optional, so theme designers should know what they're getting in to before they override hundreds of files.