Hi guys,

As a follow on from a discussion that started pretty much on Jeff Eatons Blog and his musings On the complexity of Drupal theming here is an idea I have been thinking about for a while that might be of value to Drupal.org. Feedback, flames and ideas welcome.

The Theory

In a nutshell, Jeff has identified the complexity of Drupal theming and the fact that most Drupal themes on other sites are 100% site-specific as a reason why there are so few contributed themes on Drupal.org. Good point. But, I tend to disagree...the same could be said for modules, but, judging by the amount of modules contributed..it doesn't seem to be the case.

Modules start life as a 100% site-specific "template" of functionality and contributing a module is 1000 X times more difficult than contributing a theme.

Similarly, some would argue that Drupal (php) snippets start life as 100% site-specific entities, yet since I started the Sliced Bread PHP Snippets handbook section....it has exploded.

I would reason that there perhaps isn't a culture of sharing themes within the community. I maybe wrong...but, I'm willing to chance my arm that if the community was "nudged" a little in the right direction...we would see more people share their theming gems.

I have given this a good bit of thought..and my guess is that nudging the culture of sharing themes may work, but, I think it might be wiser if we "modularise" theme contributions.

IMHO that will be more succesfull at attracting contributions and I think, long term, a theme snippets respository will be more valuable than just increasing entries in the themes folder.

What I mean is that approaching theming with Drupal is not comparable to ZEN-Garden, for example...which is pretty much a 1-page-skinfest. There's a lot more to it than that...similarly, porting wordpress or php-nuke themes isn't really of much value. Drupallers are just going to strip them apart anyway.

Instead of more themes..I'd like to see the emergence of a CSS & TPL snippets repository, where the contributions are more modular. i.e. Template (TPL.PHP) snippets with accompanying CSS style snippets to make your blogs, comments, blocks, menus, footer etc. etc. look a certain way.

There's no harm in having more "shells" to get people started but, the snippets approach, to me, would be more powerful and practical than more "complete" themes.

Anyway..that's my take on why there are very few contributed themes with Drupal and instead of "nudging" the culture of contributing back more themes or running competitions - as was suggested, I think a more modular approach to theming..where Drupallers can copy and paste tpl.php snippets or straightforward CSS style snippets would be more valuable.

Proposal for Drupal.org

So..the proposed theming contributions library would be based less on "full themes" rather on small modular snippets...as an illustrative example, if you click through to the PHP TEMPLATE section on the handbook...select "Example - Theming the user profile pages" and then select "User profile page Snippets".

If you consider that pattern replicated for blogs, comments, pages, admin pages, blocks etc. it enables Drupallers to not only contribute easily (as was proven with the Sliced Bread PHP Snippets section) but empower their theming skills.

Ideally....Drupallers would be encouraged to contribute

(a) tpl.php or alternative theme engine snippet
and
(b) CSS Style snippet that accompanies the tpl.php snippet.
and
(c) a screenshot of what it looks like. not of the full screen. Just the area affected.

I hope that makes sense and others agree...please post feedback/other so we can perhaps formulate a more efficient way of storing the snippets.

the handbook is great, but, it's not really constructed as a fluid and intuitive knowledge base, so for the above to work..a bit of work needs to be done on how best to structure it. Something along the lines of the following OPEN SOURCE snippet library might do the trick..http://www.php-csl.com/snippets/index.php

Any thoughts/opinions/feedback?

Dub

Comments

sepeck’s picture

People need methods and strategies so those should probably go in there as well.

I have a page.tpl.php. I even have a css for a three column design. Here's the catch, unless you use a table like box_grey does to contain the columns, it is almost imposible to get the css is 'fail' gracefully if you remove the left or right column. You end up with this ugy blank space on the left or right where the column was.

I have what I have done on my site so far. I need to do some more too I suspose. I like the theme/whatever snippets repository. I don't think anyone would be against the idea so talk to Charlie Rose and add the section in the handbook.

I think we should stick with using Drupal as the base for whatever is stored/thought up. I dislike the idea of using something else to store Drupal stuff. It ends up being yet one more system to manage user rights/access/maintence/links too. Besides, it might encourage someone who gets tired of looking at it to come up with a better integrated system :)

-sp
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

Dublin Drupaller’s picture

I agree Sepeck...

Some of the themes available on Drupal.org at the moment are "as is" and complete. Which is based on the logic that anything else that follows *has* to cascade underneath the core style.css and layout or else it breaks.

A symptom of that is so many Drupal sites end up looking the same.

I like the idea of having a basic "blank Canvas" theme, which is constructed modularly, i.e. instead of one big style.css with everything lumped in, you have:

  • page_container.css
    Contains the styling for the main page elements.
  • accessibility.csscontains styling tags for site-wide accesibility standards
  • print.css
    contains styling for "printer friendly" site wide styling
  • handheld.css
    contains the styling for "mobile or handheld" standards
  • blocks.css
    Contains the styling for the left/right blocks
  • Menus.css
    contains the styling for menus
  • node.css
    Contains the styling tags for standard nodes
  • blog.css
    Contains the styling tags for blog nodes
  • comments.css
    Contains the styling tags for comments
  • book.css
    Contains the styling tags for book pages
  • etcetera.cssother styling tags

Now that might sound boring, or an overkill compared to just having one big style.css...but, I think it makes sense. especially if we agree on the idea of the theme snippets repository.

I was very new to PHP and the concepts of CSS when I first started using Drupal and I have since discovered the sheer power of CSS when implemented correctly. A power that is underrated, I think. I guess many would tend to hack a module to do something rather than consider whether they can do it using CSS.

The temptation to "be like everyone else" and have a large number of contributed themes like php-nuke, wordpress and others is strong...but, I think the above, would not be just cutting edge...it would be more "bleeding edge".

The majority of the themes contributed to CMS sites are truly *AWFUL*, *UNUSABLE* and should be classed as criminal in some cases. So while Drupals.org's theme folder might look sparse, I think we should look instead in the direction of what I have outlined..i.e. a *true* cascading style sheet contributions repository.

I would prefer that, rather than a theme contributions folder full of shabby, ugly and unusable themes.

hope that makes sense..

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

venkat-rk’s picture

I think it is certainly an idea worth trying out going by the success of the PHP snippets repository.

But, I also think its success owed to the fact of not disturbing the drupal.org status quo too much (hint, hint;-)). You started with a forum topic and moved it book pages when it grew unwieldy.

I think if you start with a book page and some example snippets, people will start pitching in.

Dublin Drupaller’s picture

I agree ramdak..and I've already sort of started with the user_profile pages..which is "one I prepared earlier" type thing and was relatively easy to kick start...if you click through to the PHP TEMPLATE section on the handbook...select "Example - Theming the user profile pages" and then select "User profile page Snippets" it should make sense as an illustrative example.

If you imagine the same for blogs, comments, flexinodes, blocks, etcetera. it could turn out to be quite useful...although there is a clunkiness with the handbook as it is at the moment that doesn't really suit a knowledge base like that. The Sliced Bread Php Snippets page really should be categorised in a simple and intuitive way...

For the theming snippets idea, it would be paramount that Drupallers can submit a screenshot of what their snippet looks like. Which would might nudge an installation of the flexinode.module combined with a well thought category architecture that lends itself to an evolving knowledge base.

I appreciate that the core developers are neck deep in code at the moment, so I might start an off-site demo/test using Drupal with a view of moving it across to Drupal.org once a suitable and intuitive architecture is sorted and is accceptable to the rest of the community & core team.

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

venkat-rk’s picture

...so I might start an off-site demo/test using Drupal with a view of moving it across to Drupal.org once a suitable and intuitive architecture is sorted...

I think that's a good idea and easier to implement than trying to bring about changes on drupal.org. This is common with many open source projects (thunderbird had all its help on a third party site for a long, long time) and even some big hosting companies (Pair Networks, Site 5).

Since your intention is to genuinely help drupal users, I don't think there is any harm going off-site.

Your user profile page snippets were excellent. You put in a tremendous amount of work there. I almost used them for the site I am working on.

Enough said. Let me not divert this discussion.

Dublin Drupaller’s picture

Thanks Ramdak..

The user profile page snippets are a bit obtuse as a starting point, ie. a blog or comments snippets page might be more in demand...but it is a starting point and hopefully the community pick up on it as well as they did with the sliced bread snippets.

My proposal is quite simple, but, it is essentially asking for a change at Drupal.org. offshoot Drupal sites only increase the scattering of the community and creates problems down the road with development and the general well being of the project, so, I'm hoping that some of the core Drupallers connect with the idea and champion it..

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

behindthepage’s picture

Modular templates and CSS is the way to go.

Start with a very basic Stylesheet then add extra module related sections. It will be easier to use and mean a lighter stylesheet.

The only drawback will be the stylesheet may not cascade as well as a complete drupal stylesheet BUT I think that is a small price to pay for a more easily understood and editable CSS system.

gpdinoz
"If we can see further it is because we stand on the shoulders of giants"

Regards
Geoff

Dublin Drupaller’s picture

+1 for the basic stylesheet idea, I couldn't agree more.

What do you think of the blank canvas idea I outlined above?

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

behindthepage’s picture

YES! Excellent idea. You can just add the bits you need and it will be sooo much easier for (newbies and the rest of us) to understand and develop new parts.

Instead of having to think of the whole all at once you can develop a theme step by step.

gpdinoz
"If we can see further it is because we stand on the shoulders of giants"

Regards
Geoff

Dublin Drupaller’s picture

that's precisely what I meant..modular theming as opposed to kitchen sink theming.

Am trying to dig out whom I shold contact on the Drupal.org side to get the go ahead for this.

Anyone know?

I don't want to spend a bunch of time, energy and effort if this isn't in tune with what the core team wants, if it's already a work in progress behind the scenes or other...would prefer to know now if any of the above applies.

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

laura s’s picture

I think the biggest barrier to themes contributions is CVS, a system that may be quite familiar to many module programmers -- or at least on the easy side to pick up -- while seems rather arcane and inscrutable to designers. I can say that from first-hand experience I've been blocked by CVS implementation, from having to find and download developer tools to my Macs and then find a CVS client that actually works on more than a command-line level (I mean I started computing on punch cards and spent many years working in DOS, and I do not relish going back 20 years just to play in CVS).....well, it's not working yet.

I'm thinking of just biting the bullet and paying the bucks for BBEdit, which boasts CVS, but who knows? I'm still trying to understand what CVS actually is. I read the definitions, but in the end it sounds like a fancy-ass FTP program, and I'm sure it can't be just that or why deal with all the headache?

I code, I save files, I have my archives, I do database stuff -- but I have no occasion to use CVS except to contribute here, and with everything happening every day, well, it just ends up being on the list for the next day.

So I think any approach to theming contributions that avoids the CVS barrier I think its a good thing. If it's implemented in the handbooks, I'll be delighted to contribute there, as the occasion arises.

Laura
===
pingVisionrare patternscattered sunshine

_____ ____ ___ __ _ _
Laura Scott :: design » blog » tweet

eaton’s picture

CVS *is* a lot like FTP, in the sense that you store and retrieve files with it. There's a really critical difference, though. When you upload a new version of a file with CVS, the old one is preserved. So, for any file in the CVS archive, you have a complete record of all changes ever made, who made them, and comments on why the changes were necessary.

If you find a problem in some code, or realize that the version of a theme you were using in 2003 was actually BETTER because of some arcane technique, you can walk through the history of the file and roll it back, or isolate the differences.

There are other advantages, too, but in general it's the only way to go for stuff that you really want to track and keep on target.

You're right, though: for sharing small chunks of reusable code, tips and tricks, and helpful snippets of CSS styling, CVS is a bad fit. That's why I think a couple of Forum threads and -- eventually? right now? -- Book Page would be great.

--
Jeff Eaton | Click Here To Find Out Why Drupal "Sucks"

--
Eaton — Partner at Autogram

Dublin Drupaller’s picture

I think you have a point Laura...about the CVS being a little clunky or the opposite of intuitive for non programmers unfamiliar with CVS concepts.

Although, I can see the sense in maintaining the status quo for core developers. They are familiar with it and seem happy with it so it makes sense to leave the core development framework the same and introduce some form of intermediary unofficial contributions section. It's been discussed to death on here with very little in terms of action..the positive about modularising theme contributions in the way I outlined means that we don't meet that stumbling block.

Drupallers were very quick to share and contribute some great Sliced Bread Snippets. It's simple, easy to do and doesn't take up too much time.

A modular theme snippet library needs something more than what Drupals handbook can offer at the moment, i.e. a knowledge base style interface and the ability to submit screenshots...so I'm going to have a bash over the next week or two at building a simple Drupal based system, based along the lines of this style here.

If I get enough support from the community, I'll go ahead with this..as I think all it needs is a bit of planning and it will populate itself from the community over time.

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

behindthepage’s picture

Hey Dub,

I think something like the downloads section of Drupal would work rather well. Have all the different sections (page_container.css, accessibility.css, etc) in the tabs across the top and each section has a page like themes. The themes page has snapshots and a description and a link to more info. May be a bit of an overkill but could be a good place to start.

gpdinoz
"If we can see further it is because we stand on the shoulders of giants"

Regards
Geoff

Dublin Drupaller’s picture

I would actually go a stage further with the classification and categorisation of the snippets..and I agree, it's essential that a simple method of visualising the effect/snippet/theme to accompany submissions.

It will take a while to do something like this properly and I'm hoping I get some positive feedback from the Drupal team - I don't want to invest time and effort into this if it's not something they thing will be included on Drupal.org.

I am willing to take time and knock up an off-site working demo and tweak it..but, only if the Drupal team are up for it..I'm totally against off-shoot sites for stuff like this..it scatters the community and hurts the project long term.

thanks for the feedback by the way..I'm stunned by the amount of emails in my inbox this morning. It seems the community are well up for it.

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

behindthepage’s picture

Check out this page
http://www.opentravelinfo.com/taxonomy_dhtml

taxonomy_dhtml might work well for what you have in mind.

gpdinoz
"If we can see further it is because we stand on the shoulders of giants"

Regards
Geoff

andre75’s picture

Thanks for using my poorly designed page as an example.
Unfortunately this section gives me the most headache.
While it looks good in FF it has some trouble in IE.

What happened to the repository? I am in the process of theming some sites and I was wondering how far the original idea has come. Looks to me as if the project never got off the ground.

Andre

-------------------------------------------------
http://www.opentravelinfo.com
http://www.aguntherphotography.com

Dublin Drupaller’s picture

HI Andre,

It's a work in progress. Please note the new section to the handbook:

http://drupal.org/node/45471

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

andre75’s picture

Thanks for the link. This is great!

-------------------------------------------------
http://www.opentravelinfo.com
http://www.aguntherphotography.com

andre75’s picture

This is a very helpful section.
I am trying to theme a flexinode page.
Most of it is rather straightforward but I am having trouble theming a file object.
All I see on my page is the word Object. I don't quite understand how to extract the link to the file.
I could use some help with this one, please.

EDIT: I found it, nevermind.

Andre

-------------------------------------------------
http://www.opentravelinfo.com
http://www.aguntherphotography.com

the full octave’s picture

Just to echo the others, this is a great initiative and very useful link. I think the modular approach to theming as you outlined will be of immense value to everyone.

please keep it going.

Paul

-----------------------------------------------
Graphic Designer.
New to Drupal and loving it large.

tomski777’s picture

I've been playing around with this recently:
http://webhost.bridgew.edu/etribou/layouts/skidoo/index.html
(try the demos in the right hand col - its all the same base .css with small snippets added or removed.)
Which is presented as a "blank canvas" .css toolbox & is pretty straight forward to convert to a Drupal themes. I particularly like the way the .css has been split into snippets so all it takes is an extra block to add / remove columns - solving the "'fail' gracefully" problem highlighted by Sepeck. Ideas to develop on perhaps?

><>tomskii
><>www.mutinyarts.co.uk

shane birley’s picture

That are blank canvas type things for Drupal. Three column full widths, fixed widths, etc. They are good starting points that I use for my projects, but if you want, I could post them all.

---
Shane Birley
Vicious Bunny Creative
http://www.vbcreative.com

---
Shane Birley
Left Right Minds
https://www.leftrightminds.com

sepeck’s picture

the handbook would certainly welcome them....... :)

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

shane birley’s picture

---
Shane Birley
Vicious Bunny Creative
http://www.vbcreative.com

---
Shane Birley
Left Right Minds
https://www.leftrightminds.com

sepeck’s picture

That's the easiest. And as I think you already know, you can use the code and php tags to seperate out code examples and such as mentioned inthe Input format below the comment body input field and such. :)

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

shane birley’s picture

I will do that in the next couple of days. I will add some notes for people so they can understand how they work. Actually, something I should check first, what page should I be adding these to?

---
Shane Birley
Vicious Bunny Creative
http://www.vbcreative.com

---
Shane Birley
Left Right Minds
https://www.leftrightminds.com

sepeck’s picture

You would ask....... :)

We have two choices... If it would fit in the phptemplate theme snippets then great. But I have a fealing it won't quite fit. (Dub had a great idea with that seciton but it didn't fit how I was redoing that book so I'm waiting to see how things develop before I move stuff in it. 'Bout to start in the next week or two though.

The second choice is the Site Recipes spot which is sort of a catch all for that section (on purpose) at this point. I can move it later if we need to.

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

shane birley’s picture

I will keep watching this thread and see what comes out of it for the organizational heirarchy. Until then, I will dump them into my sandbox and then add them in when things get organized.

Does anyone need help in organizing or is Dublin doing it all? I can lend a hand where it may be needed.

---
Shane Birley
Vicious Bunny Creative
http://www.vbcreative.com

---
Shane Birley
Left Right Minds
https://www.leftrightminds.com

sepeck’s picture

Well it's about that whole book. I had a plan, Dublins addition just complilcated it somewhat. It was a good content I'll live with it addition and refigure it out, but still made me refocus. I have a tentative outline which I will be sending to the docs list soon for that book. (Each H2 heading on the /handbooks page is a seperate book).

That book is more complicated because it didn't exist as an entity before January. Elements and content did but not like the Installation and Configuration book material and content. That section also needs some additional pages written which I'll touch on in my outline. (more than happy that others write them too :) Not sure, but I will try and get a tentative outline this weekend sent to the docs list. I think people will like the strategy overall. Sort of not much different but with some additional landing pages and ordering of content. I also want to get some HTML snippets going that isa suggested. php content type let's you do fancy things, but so does Full HTML tricks too.

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

shane birley’s picture

Very cool. I am on the docs list and will read with interest. If I can do anything, let me know.

---
Shane Birley
Vicious Bunny Creative
http://www.vbcreative.com

---
Shane Birley
Left Right Minds
https://www.leftrightminds.com

Dublin Drupaller’s picture

Hi Sepeck,

"Dub had a great idea with that seciton but it didn't fit how I was redoing that book so I'm waiting to see how things develop before I move stuff in it."

Just a quick one..I had an idea of how it might work well alongside the Drupal handbook, is it better for me to build that away from Drupal.org using Drupal 4.7 and then showing it to you? or will I just contact you direct to talk it through in case you already have an idea of how it will work.

The key thing about the Drupal.org handbook (in my humble opinion) is that we really need to seperate out INSTRUCTIONAL pages from EDUCATIONAL pages and style each accordingly.

An example of a simple and straightforward step-by-step Instructional page might be the following:
Customising the user list layout. It's very direct and straight to the point.

Where as ths following might be a good example of an EDUCATIONAL page. which is more discussing/explaining the concepts behind something, in this case Introduction to Drupal terminology.

The STYLE.CSS SNIPPETS section I have planned to sit alongside the PHPTEMPLATE THEME SNIPPETS section really needs a visual reference to accompany the snippet. As an example, a small screenshot of how a PRIMARY LINKS snippet might look, followed by the snippet to copy and notes, such as which browsers it works with or if it does/doesn't validate etc.

I can build something simple as an illustrative example of what that would look like Sepeck, but if you already have that idea in motion, let me know and I can just start the section with your template.

I hope that makes sense...I'm working today, so if you're around drop me an email.

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

sepeck’s picture

Your section was in the same area I was thinking of but done differently. Now I don't mind becuase there's lots of ways to do things and I'm all for going with a different aproach if it works better. It just made me pause to see how it worked out. (Then I got busy :) Customization and Themeing in Drupal is by it's very nature different and requires a lot of potenitally different skills (layout, design, usability, workflow, php, sql). There is no one true way and that whole section needs lots of 'approach' type guides that are by their very nature harder to write. So adaptation is going to wrap around your direction at this point.

Shoot me an email and we can schedule some time.

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

Dublin Drupaller’s picture

quick one..

appreciate you're busy Steven, but, if you could let me know what's the best way to approach this, I'd appreciate it.

Whenever you get a chance, just drop me an email.

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

Dublin Drupaller’s picture

Great stuff Shane.

(I was travelling over the last few days, so only just saw this now)

I'll be updating parts of that new handbook section tomorrow, so I will send you a link and show you how to insert the pages yourself.

The basic concept is to approach theming on a modular basis, as opposed to asking people to submit full themes.

In simplicity and as an example, the Drupalicious theme I'm working on will be an ANY BROWSER "blank canvas theme" where it's very simple and easy to copy and paste STYLE.CSS snippets for page layout (2-col, 3-col etc.) or primary link style snippets...and so on. I.e. we could have 10 different style.css snippets just for the primary links that a user can copy-n-paste very quickly.

I hope that makes sense Shane. I'll drop you an email tomorrow to explain more and get the style.css snippets section of the handbook started so you can add pages in your name to the handbook (your username gets credited with each submission).

I'm 99.9% certain the module approach to theming will work very well.

I don't know about other people, but, a lot of time is spent stripping apart downloaded Drupal themes while I notice that the other handbook sections I started, the SLICED BREAD PHP SNIPPETS SECTION and now the PHPTEMPLATE SNIPPETS SECTION have grown very quickly and are often used.

having the extra option of allowing users to just download full themes or build from the bottom up, using copy-n-paste modular approach - I think will be just as valuable as the other snippet sections. And easier to contribute into.

That's the idea anyway..fingers crossed it will work out..

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

shane birley’s picture

I believe I had a "lightbulb" moment just now.

I keep the layouts I have (as they are now) in my sandbox - but they can I can develop them in the direction you are thinking. That is what this is all about. Many different ideas slamming together, getting messy, and then we can pull together to make them cooler - or something. :)

---
Shane Birley
Vicious Bunny Creative
http://www.vbcreative.com

---
Shane Birley
Left Right Minds
https://www.leftrightminds.com

Dublin Drupaller’s picture

yeah..

It's essentially taking a leaf out of how the zen garden site and others like it have evolved.

Consider a theme called blank_canvas which validates and works in Any Browser (including wireless/mobile browsers) whereby the class names are standardised.

If we renamed the style classes in your contributions to match that theme, a Drupaller could, very easily, just copy-n-paste the styles needed for a 2-col, 3-col or 4-col page layout. So, they are *just* pasting the classes that does that.

Similarly, the same could be done for *just* pasting style classes to display the primary/secondary links in a particular way. not unlike how the LISTOMATIC SITE does it...

My long-term vision is for a more advanced styling resource for drupallers on drupal.org such as;

blog.css
header.css
blocks.css
aggregator.css
ecommerce.css
front_page.css
audioandvideo.css
mobile.css
pda.css
wireless.css
userprofile.css
etc.

I hope that makes sense...

I also see the PHPTEMPLATE SNIPPETS SECTION evolving into a marraige between css/php. where PHP snippets might come with their own accompanying CSS classes that can be copied an pasted by users to achieve a particular FUNCTION + STYLE. An example of that might be the DRUPALICIOUS -BLANK CANVAS theme I'm working on for this section. It mixes PHP with CSS very well. For example you can control the primary/secondary/other colours in a site by just editing 1 file.

Here's the controlling mix of PHP & CSS:

<?php
header("Content-type: text/css");
$primary = '#88c';
$primary_highlight = '#9932CC';
$secondary = '#707070';
$highlight = 'red';
$bg_colour = '#fff';
include("main-styles.css");
include("header-and-footer-styles.css");
include("block-styles.css");
?>

So, in the stylesheet itself, you can use PHP to call the color like this;

body {
  margin: 0;
  padding: 0;
  color: <?=$secondary?>;
  background-color: <?=$bg_colour?>;
  font: 78% Arial, Helvetica, sans-serif;

}

Simple stuff, but incredibly useful for designers and typographers who want to control the layout & look of their site across browsers and platforms.

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

laura s’s picture

It had not occurred to me that php could be embedded in stylesheets.

Laura
_____ ____ ___ __ _ _
pingVision, LLCBlogHerrare patternscattered sunshine

_____ ____ ___ __ _ _
Laura Scott :: design » blog » tweet

Dublin Drupaller’s picture

Hi Laura,

It's actually very useful.....that snippet works perfectly for controlling the colour pallate for a site...especially useful when you start getting into projects that require accessibility settings (high contrast between primary and secondary colours) and wireless devices (when good looking typography with backgrounds won't work), or simply trying out different colour palletes/combinations.

Another example might be for a site you would like to "go dark" at night and "go bright" during the day...using the time of day to determine what colours to use.

That's the first mix of PHP & CSS "proof of concept" I've got working...so I'm only dipping my toes into it. My guess is that it might be an extremely valuable resource if we pushed the CSS - STYLE SNIPPETS section of the handbook/drupal.org to sit alongside the phptemplate snippets.

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

Rosamunda’s picture

I´ve got nothing to add to this conversation, but as commenting on a thead is the better way that I now to keep traking of terrific and very interesting conversations... well... that´s it.

Thanks.

Rosamunda

Anonymous’s picture

Coming from a CSS/XHTML background, I think the modular idea for themes makes a lot of sense.

One thing I find with most Drupal themes is that there is no real semantic document structure - everything is either tables or a series of divs. If, like Zen Garden, a robust XHTML document structure could be built, then it would be relatively easy for people like me to create themes with CSS.

I also find with Drupal that the seperation of presentation from document strucutre is sometimes lacking. Modules, or blocks will spit out extra XHTML that I don't want or need. I realise that this may be because of my lack of understanding so far of how Drupal works, however.

I would also go so far as to say that almost all column layouts can be achived with pure CSS. One of the first things I did when playing around with Drupal was to redo the standard BlueMarine layout using CSS only.

David McDonald

Freelance web designer
------------------------------
http://www.davidmcdonald.org

deathgod’s picture

The new zen theme for drupal 5.0 is said to be a framework theme. I haven't actually taken an in-depth look at it yet but do soon, maybe you should also dublin.
------------------------------
Naruto - narutomonkey.net - Naruto Forums

gurukripa’s picture

hi guys
so whats the truly versatile theme? something where we can drag and drop things? make the best use of space?
sorry just thought i would ask a few questions to get the discussion going...:)
seems this topic is getting forgotten....i guess its too good a topic to drop

Dublin Drupaller’s picture

so whats the truly versatile theme?

I'm working on a theme at the moment that has every key element in a Drupal site already overriden...so if you need to modify the search box, breadcrumbs, forums, profiles, blocks, etc. the overrides are already in place. So when you're delivering the finalised theme, you just delete the overrides you're not using.

That modular approach to theming is, I think, the way forward.

That's just my opinion, but, it's much easier for a designer to hack away at phptemplate snippets rather than (a) go looking for help (b) getting their head around how to implement it (c) implementing it.

In other words, I really think we will see a growth in sharing more phptemplate snippets along with .CSS snippets to accompany them. In the same way the modular approach to features works so well , there's no reason why a modular approach to theming wouldn't work just as well.

hope that makes sense..and thanks for reminding me about this discussion.

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

Dublin Drupaller’s picture

Hi guys,

In case anyone was subscribing to this thread..please note..

I've been threatening to start this section for a while now.

I really wanted to pull it out of the Drupal handbooks - I think the handbooks aren't designed very well and are ill suited to snippets + screen shots + quick navigation. I'd prefer if we kept it seperate in a Drupal designers knowledge base that has php/css/template snippets and a reference guide similar to http://api.drupal.org but specifically for designers and in non-programmer-speak.

That said, I have attempted to kick-start the idea in the PHPTEMPLATE sections of the handbook, using the forums as a starting point.

Click on the link below...it should be self explanatory now it will work.

Customising the FORUM_LIST layout
(That's a work in progress, but the snippet has been tested on Drupal 5.x)

The concept is very like the other PHPTEMPLATE theme snippets, but, it also carries STYLE SHEET snippets you can drop into your own theme along with the snippets.

hopefully it will spark some ideas...and an understanding that the modular approach to theming should really be looked at (not in the handbooks, but in a seperate "Designers Knowledge base" that is instructional rather than explanatory).

Let's see how this section contrinues and maybe we can look to perhaps moving it out of the handbooks as mentioned. If it grows as quickly as the PHP TEMPLATE THEME Snippets concept has over the past few months, that might not be long. I popped in there today to try and tidy up the whole section and was astounded at the amount of snippets that reside there now.

And if we're looking for a quick n simple Drupal navigation for a "Designers Knowledge Base", I would point to http://isaachorton.liquidratio.com/ as a great example of using Drupal taxonomy cleverly to move around and navigate quickly and easily.

If that was on a bright background, with dark text (as opposed todark background with bright text) I think it would be a great way to organise all the snippets in a seperate "Drupal Designers Knowledge Base".

Whaddyathink?

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate