I have outputted a first draft of Drupal 7 phptemplate cheatsheet.
It still needs review from all of us so we can reach a fine one that can be useful for every drupaller.
Download it from here
Review, comment and advise so we can publish an effective one.
Maybe we should inluclude more general rules in it, e.g. I had troubles with printing custom menu. Here is more or less code from default tpl files, which are in general easy to find.
It looks good on my initial view of it. However, it would be nice to have a version number or release date on the page, so that if we see another version online, we can compare date stamps to know which is more current and/or related to the drupal revision we are using.
To theme a custom page by Node ID you need to add 2 dashes before the ID. This seems to apply to anything theme file that contains a 3rd level specifier. page--node-260.tpl.php (wrong) page--node--260.tpl.php (correct)
You didn't address the search box. I am having an awful time moving the PHP code for the search box in my page template. I keep getting an undefined variable error.
I've carefully followed the tutorials and Readme's. I'm trying to make a Zen sub-theme using STARTERKIT. I did the name changes, etc, but when I clear caches, I get the error:
Notice: Undefined index: name in block_menu() (line 146 of /home/sbjazz/public_html/modules/block/block.module).
Notice: Undefined index: name in block_menu() (line 165 of /home/sbjazz/public_html/modules/block/block.module).
Notice: Undefined index: name in system_menu() (line 647 of /home/sbjazz/public_html/modules/system/system.module).
Status message
When I go to the appearance page, I get:
Notice: Undefined index: name in system_sort_modules_by_info_name() (line 925 of /home/sbjazz/public_html/modules/system/system.admin.inc).
Notice: Undefined index: name in system_sort_modules_by_info_name() (line 925 of /home/sbjazz/public_html/modules/system/system.admin.inc).
Notice: Undefined index: name in system_sort_modules_by_info_name() (line 925 of /home/sbjazz/public_html/modules/system/system.admin.inc).
Notice: Undefined index: name in system_sort_modules_by_info_name() (line 925 of /home/sbjazz/public_html/modules/system/system.admin.inc).
Notice: Undefined index: name in system_sort_modules_by_info_name() (line 925 of /home/sbjazz/public_html/modules/system/system.admin.inc).
Notice: Undefined index: name in system_sort_modules_by_info_name() (line 925 of /home/sbjazz/public_html/modules/system/system.admin.inc).
Notice: Undefined index: name in system_themes_page() (line 140 of /home/sbjazz/public_html/modules/system/system.admin.inc).
Notice: Undefined index: name in system_themes_page() (line 158 of /home/sbjazz/public_html/modules/system/system.admin.inc).
Notice: Undefined index: name in system_themes_page() (line 159 of /home/sbjazz/public_html/modules/system/system.admin.inc).
Notice: Undefined index: name in theme_system_themes_page() (line 2708 of /home/sbjazz/public_html/modules/system/system.admin.inc).
Somehow, the theme name isn't getting recognized, but I've done all the settings I can find.
Help! It's frustrating!
First of all, thanks a lot, its a great cheatsheet!
Second, I am a little new with Drupal 7. But I am working on a theme (AT Commerce to be exact), and I noticed that it has a $content_attributes variable, but I don't see this on your cheatsheet. Is this a standard variable? What exactly is it?
Comments
Great idea! Maybe we should
Great idea!
Maybe we should inluclude more general rules in it, e.g. I had troubles with printing custom menu. Here is more or less code from default tpl files, which are in general easy to find.
--
twitter: @Iztok | company: Drupal Theming & Development Studio
Brilliant! This is EXACTLY
Brilliant! This is EXACTLY what I was after. Thanks loads!
Released. Drupal 7 theming
Released.
Drupal 7 theming cheatsheet
Correct Link
I think the link got mixed up a bit. I found it at: http://batayneh.me/sites/default/files/Drupal7-theming-cheatsheet_1.pdf
Hope that helps.
Joel
Yes correct But you can
Yes correct
But you can always get it from http://batayneh.me/post/drupal-7-theming-cheat-sheet
A version number/date
It looks good on my initial view of it. However, it would be nice to have a version number or release date on the page, so that if we see another version online, we can compare date stamps to know which is more current and/or related to the drupal revision we are using.
...
There is no $highlight variable... as I pointed out in the other thread you are using to promote this cheatsheet.
Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.
Much Appreciated
I just printed it out and will be referring to it often. Thanks much.
Very much appreciated
Thanks very much for spending your time on this.
I love it. Thanks for this
I love it. Thanks for this great resource.
I did find an error and a typo.
To theme a custom page by Node ID you need to add 2 dashes before the ID. This seems to apply to anything theme file that contains a 3rd level specifier.
page--node-260.tpl.php(wrong)page--node--260.tpl.php(correct)I found the correct naming method mentioned here http://drupal.org/node/1089656
Also, a typo for your page.tpl.php example. You have a comma rather than a dot.
page,tpl.phpThanks
Just perfect!!!
Very nice, thanks! Underneath
Very nice, thanks!
Underneath html.tpl.php code, in the 1st row on the left, should '$header' be 'head'?
broken link
the link seems to be broken :(
Here you go
Here you go :)
http://batayneh.me/sites/default/files/Drupal7-theming-cheatsheet_2.pdf
Great Work thank you !
Great Work thank you !
Fantastic!
Brilliant work. Thanks for this.
Thanks buddy!
Thanks buddy!
Great Work
Great Work!
Thanks for taking the time.
You didn't address the search
You didn't address the search box. I am having an awful time moving the PHP code for the search box in my page template. I keep getting an undefined variable error.
Can't get STARTERKIT subtheme working in D7
I've carefully followed the tutorials and Readme's. I'm trying to make a Zen sub-theme using STARTERKIT. I did the name changes, etc, but when I clear caches, I get the error:
Notice: Undefined index: name in block_menu() (line 146 of /home/sbjazz/public_html/modules/block/block.module).
Notice: Undefined index: name in block_menu() (line 165 of /home/sbjazz/public_html/modules/block/block.module).
Notice: Undefined index: name in system_menu() (line 647 of /home/sbjazz/public_html/modules/system/system.module).
Status message
When I go to the appearance page, I get:
Notice: Undefined index: name in system_sort_modules_by_info_name() (line 925 of /home/sbjazz/public_html/modules/system/system.admin.inc).
Notice: Undefined index: name in system_sort_modules_by_info_name() (line 925 of /home/sbjazz/public_html/modules/system/system.admin.inc).
Notice: Undefined index: name in system_sort_modules_by_info_name() (line 925 of /home/sbjazz/public_html/modules/system/system.admin.inc).
Notice: Undefined index: name in system_sort_modules_by_info_name() (line 925 of /home/sbjazz/public_html/modules/system/system.admin.inc).
Notice: Undefined index: name in system_sort_modules_by_info_name() (line 925 of /home/sbjazz/public_html/modules/system/system.admin.inc).
Notice: Undefined index: name in system_sort_modules_by_info_name() (line 925 of /home/sbjazz/public_html/modules/system/system.admin.inc).
Notice: Undefined index: name in system_themes_page() (line 140 of /home/sbjazz/public_html/modules/system/system.admin.inc).
Notice: Undefined index: name in system_themes_page() (line 158 of /home/sbjazz/public_html/modules/system/system.admin.inc).
Notice: Undefined index: name in system_themes_page() (line 159 of /home/sbjazz/public_html/modules/system/system.admin.inc).
Notice: Undefined index: name in theme_system_themes_page() (line 2708 of /home/sbjazz/public_html/modules/system/system.admin.inc).
Somehow, the theme name isn't getting recognized, but I've done all the settings I can find.
Help! It's frustrating!
Thanks a Million!
Thank you. This was useful!
$content_attributes
First of all, thanks a lot, its a great cheatsheet!
Second, I am a little new with Drupal 7. But I am working on a theme (AT Commerce to be exact), and I noticed that it has a $content_attributes variable, but I don't see this on your cheatsheet. Is this a standard variable? What exactly is it?
Link Broken
All the links pointing to the cheatsheet are broken, is there a working linking for it.
P.S: I think it should be stored some where on the cloud to avoid hosting issues and extend the projects live.
Nice one
Here you go: http://worchestra.com/sites/default/files/Drupal7-theming-cheatsheet_2.pdf