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 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
|
||||
Posts: 7994
"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.
Posts: 974
By "after work" bharat means "at my desk."
Posts: 113
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.
Posts: 1301
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
Posts: 1301
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
Posts: 113
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 ;)
Posts: 808
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.
Posts: 1301
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:
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
Posts: 113
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.
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. ;)
Posts: 808
If you don't like your username just sign up again with one you like :wink:
Posts: 113
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 ;)
Posts: 7994
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?
Posts: 113
[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:
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)
Posts: 113
Posts: 7994
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.
Posts: 113
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.