[drupal-devel] [task] Introduce theme wrapper, as discussed on the Sprint

Bèr Kessels drupal-devel at drupal.org
Wed May 25 12:45:50 UTC 2005


Issue status update for http://drupal.org/node/23584

 Project:      Drupal
 Version:      cvs
 Component:    theme system
 Category:     tasks
 Priority:     normal
 Assigned to:  Bèr Kessels
 Reported by:  Bèr Kessels
 Updated by:   Bèr Kessels
 Status:       patch
 Attachment:   http://drupal.org/files/issues/box_to_wrapper_core.patch (3.8 KB)

... and here is a patch for core that replaces all theme('box' calls
with new wrapper calls.




Bèr Kessels



Previous comments:
------------------------------------------------------------------------

May 25, 2005 - 13:34 : Bèr Kessels

Attachment: http://drupal.org/files/issues/theme_wrapper.patch (1.23 KB)

I finally got around this.
On the useability sprint inAntwerp we agreed that theme_box is:
1) not flexible,
2) underused
3) very powerfull for themers, consistancy and developers if it has
enough information.


This patch introduces such a function, called theme_wrapper.
Theme('wrapper') should be called EVERYWHERE where we now have
hardcoded spans and divs, only to be able to add a class or ID to a
(part of -) a page.


>From the notes:


"
 ** HTML themed wrapper **
Currently, we use a theme_box to wrap parts of pages in HTML. This
should be extended, but most of, all, get better CSS support.
Thus a wrapper should be introduced, one that should replace theme_box.
This theme_wrapper can and/or will get an ID and a class.


* Both class and ID should be passed as elements, so that it is up to
the developers to pqss correct classes  and Ids;
* Both the ID and class are required. (?)
* Discuss whether or not they are required.


 **List of classes.**
When passing a class, the developer should be encourqged to choose an
existing class, instead of inventing new ones for every wrapper. This
will be achieved by a list of standard classes, that will be available
in drupal.css.
Think of classes such as “3-col-left”, “3-col-center” and
“3-col-right”, for wrappers that will make content in a 3 columned
way. This could be used, for example in a directory.module to present
three directories next to one another.
TODO: Create a standard set of classes, that can, and should be, (re-)
used by developers. 


 ** Ids**
Ids should be unique on a page, thus the developer must make sure, he
or she does not use an ID  that  is already existing on the page where
his or her HTML will be rendered. But just like with the classees, we
should avoid a wildgrowth of ids. Thus, good guidelines, including
lists of examples, lust be written.
TODO: Create guidelines for ID-ing elements in Drupal.


"





More information about the drupal-devel mailing list