[support] A shot in the dark - was Drupal themes

vlado vlado at dikini.net
Thu Apr 6 08:18:17 UTC 2006


> You said to only apply a style on a particular page.  The problem is
> for me and I risk feeling ignorant, but the pages are not created as
> static pages. 
Well, yes. And that's the "problem". The structure is conditional and
depends on context. I have my grudges with it as well. The key to
theming is understanding when certain structures appear and why. An
example - although you have one and the same title for a node, it can
appear as a different <hX> element in teaser and node views, as it
probably should. There is a semantic difference there.

> I can't look at an xhtml page within the code, as there are no xhtml
> pages in the code.  So, I've got the .node .content black
>  and so the image area around a picture is black but that's only a
> small part of the display area.   The home page is a book page made
> from an image in a photogallery.  I didn't feel so ignorant or
> confused using Drupal in a long time until I started trying to do
> this.  I didn't think CSS was all that confusing. 
You have .tpl files and you have default theme functions. The
definitions in a .tpl file override the defaults. Most of the defaults
are snippets in code. Look for the *_theme functions to get all
defaults. The .tpl is simply html with a bit of php thrown in to inject
content.
 
> The problem for me is that every page is being generated with php, so
> I can't just open a page in Dreamweaver and look at the Style on a
> part of the screen.  There doesn't seem to be a way to edit these
> things in a WYSIWYG, type display environment... where I'd be able to
> apply a style and see that indeed there was a change to the background
> and then see the text and try a lighter text, all this in one step.
> It's like I have to try a change and then upload it and see if there
> is any change.  Can anyone offer any tips?
If you want to apply the black-box method. Open drupal.css and the
theme's css files in a handy editor. Open a page of a certain type -
a list, a node view (they differ on node type), an editor form, admin
page, etc... Use the CSS->Check Style Information and/or
Information->Display ID & Class Details to get idea of the possible
selectors, which could have been aplied. And find which rules are 
influencing the display. Or just ignore that, and define a CSS rule of
sufficient specificity - that's a trial and error. 
You can alway put in your theme file an id, like <body id='my-special'>
and do something like #myspecial h2.title {} to guarantee that your
rules are preferred by the browser.

> ..... If the design of a theme was based on a dark or black background
> for the content and menu areas, things would be a bit easier for me.
> It would be a better place to start for me.  There aren't any themes
> with this are there?
You are getting from the wrong end - colours and such. Look at what
resembles your layout - it is the most difficult part of the design.
The coulours will come from that. Unfortunately there is a lot of black
magic involved in good css design. Or so it seems.

Cheers,
Vlado




More information about the support mailing list