Closed (fixed)
Project:
Zen
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
11 Oct 2006 at 00:43 UTC
Updated:
6 Nov 2006 at 01:15 UTC
Jump to comment: Most recent file
Approximately 80 gabillion support questions would go unasked if we had an example template.php in the default core theme.
Ideally, this template.php file would include:
1. An implementation of the regions hook, to declare a new block region.
2. An example override of a theme function.
3. Doing something with _phptemplate_variables, such as creating a front page template that was only shown on the front page.
4. Copious amounts of inline documentation to describe what was doing what and why (think settings.php).
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | template_0.patch | 3.03 KB | webchick |
Comments
Comment #1
jjeff commentedCheck out the current template.php file. A bunch of this stuff is already in there.
Comment #2
jjeff commentedWhoop... uhhh... maybe not. Nevermind. :-)
Comment #3
m3avrck commentedFixed.
Create another issue + patch to tweak the file more / add in more / etc.
Great idea!
Comment #4
zirafa commentedI've modified this file to reduce and clarify the help text. I think having too much text is just as bad as not enough.
I am not entirely convinced these examples belong in this template.php file however. I don't see how this is an advantage to a good template.php example on drupal.org. That way other themes could also link to this same example and there would be consistency in documentation.
Comment #5
zirafa commentedSorry, I meant to say, I don't see how including these examples is more advantageous than just providing a link to an example on drupal.org.
Comment #6
scroogie commentedWell, the thing with documentation is that the people dont read it... having the basic examples in a core theme helps by really _demonstrating_ the possibilities and lets the people try out stuff.
Comment #7
webchickYep. No one reads documentation, and I say this with some authority as someone who spends an awful lot of her time writing documentation for Drupal.org. ;)
Plus it creates a dependency on a) having an Internet connection and b) Drupal.org to be up and running if you're trying to make a custom theme.
There's really no substitute for having self-documenting and easily modifiable code included in the package, imo.
Comment #8
zirafa commentedI'm convinced! Leave it in! :)
But please review some of the changes I made to the document. There is always room for improvement and clarity.
Comment #9
webchickLooking great, guys!!
Here's a patch that contains some minor formatting fixes and some other stuff.
Comment #10
jjeff commentedI'd really like to see examples for the 'node' and 'comment' cases of the _phptemplate_variable() function.
Zirafa, would you be okay with bringing back those from this commit:
http://cvs.drupal.org/viewcvs/drupal/contributions/themes/zen/template.p...
I think it's a really important concept for people to understand.
Comment #11
zirafa commentedSure, I just didn't like how the whole function was commented out. I'd prefer them be actual usable examples but I'd be alright if these ones were commented out.
Comment #12
jjeff commentedcommitted.
Comment #13
(not verified) commented