By Swift Arrow on
Hi all...
I've been trying to nosedive into theme developement with drupal5 and zen1... am a bit puzzled about a few things:
- There are a few different css stylesheets in our subdirectory, including one called style.css. While all the others seem to have some meaning, it is blank, except for a comment. Looking in Template.php, it is not linked to or included in the stylesheets listings in any way... I experimented deleting it, or renaming it, and that completely broke the theme, until I put it back.
- WHAT is it there for?
- Is it alright to put our own style declarations in it? (it seems to work, but is it "acceptable"?
- In the template.php file in the subdirectory, it says that zen subthemes may have their own template.php files, but they may not redifine any existing functions in zen's basic template.php file. And then it has a tonne of functions all commented out saying that if we want to we can uncomment them to use them. They are almost exactly the same as the functions in zen's template.php file. So:
- Can we use those functions?
- Can we use our own functions? How?
- Dont the comments conflict themslves, when they say that we cant redifiene those functions, and then allowing us to override them by uncommenting in our template.php?
- Looking at the HTML output, it seems that there is alot of extra tags and classes that perhaps are not needed by me. In my case, it seems to be a little bloated. Can we cut all those extra tags, divs, classes, etc? Will the site still work?
Thank you,
SA
Comments
Busy???
Hope keeps one alive.... :)
It's really bugging me.... cant find a reason anywhere.
better late..
better late than never...
I don't know why no one answered your post before. Maybe you still need those answers, otherwise, this will be for future reference. Let me tell you the answers that I know:
Drupal will throw errors if style.css is not available. It is loaded by default, but Zen chose to do it differently. I dont know why.
In php, you can only declare a function once. If zen_links() is defined in the main theme, you cannot redefine it in the sub theme. You will have to edit the parent template.php; either edit the function there, or delete/comment it and place your own override in your sub theme's template.php.
Note that a theme override function can have different names. When you're using the Zen theme, Drupal will first look for the function starting with the template name: zen_links(). If that is not available, Drupal will look for the function starting with the template engine name: phptemplate_links(). If that function does not exist as well, Drupal will fall back to the default theme_links() function. This means that if phptemplate_links() is defined in the template.php of the parent theme, you can still define zen_links() in your sub theme.
Some of Zen's divs and classes look unnecessary, that's true. In fact, some are unnecessary in certain cases. I have experienced that removing them can sometimes be done without consequences. On other occasions, it turned out to break the lay-out (always test IE6, Safari, Opera!). I've have also experienced that the usefulness of certain classes and divs only occurred to me after a while, so I had to put them back in. I have come to the conclusion that Zen is very well designed at that removing divs and classes does not really offer advantages.
Thank you
I had given up on this... thank you so much for your reply!
zen function question
I haven't searched too much yet. But i added some custom functions to the zen_classic template.php file. When i use it in a node or something, I get an error stating that the function is not defined...
Maybe it's a zen thing but i've successfully done this in with custom themes and it worked. Maybe you can shed some light on it.
Greatly appreciated.
/edit. replied to the wrong user so not sure if a message would've been sent to you. so i'm posting it again.
zen function question
I haven't searched too much yet. But i added some custom functions to the zen_classic template.php file. When i use it in a node or something, I get an error stating that the function is not defined...
Maybe it's a zen thing but i've successfully done this in with custom themes and it worked. Maybe you can shed some light on it.
Greatly appreciated.