Hello. :) I just discovered Drupal last week and I am loving it, but struggling to get things set up as I'd like them to be. So far I've been able to find solutions through reading and videos, but here's a simple one that I can't work out. My site is here:
When you click on a thumb, you go to an individual "post" or "node" (I'm not positive I have the terminology right), which comes from a custom content type I created. I'd like to have the header region, with the site title and logo, not display on those pages. After a bit of digging around, I THINK what I would need to do is write a PHP snippet for that, and put it in a newly-created page.tpl.php file in my subtheme folder (I'm using the Zen theme right now). But I could be wrong, and I don't know how to write PHP anyway.
I'd like to know if I have the methodology right, and of course if there's an easier way to accomplish this. Any suggestions are appreciated!
Comments
a css answer
You could use a css selector like node-type-big-picture to set the header to display:none. This is not the most efficient method, but is the easiest. The way to do it through the theme would be to create a custom tpl.php for the con tent type and remove the header from that page.
A list of some of the Drupal sites I have designed and/or developed can be viewed at motioncity.com
TYVM. :) That was easy, and
TYVM. :) That was easy, and should do for now, until I can get a handle on PHP method.
Perhaps you can try to add an
Perhaps you can try to add an if..else statement on
page.tpl.phpe.g.:Or make use of Template Suggestions by adding in your
THEME_preprocess_page()this:You can then just create different page templates for each node type.
Arnold French
Drupal Developer/Themer
Promet Solutions Inc.
4001 N. Ravenswood Suite # 503B
Chicago, IL 60613
Drupal Web Development
Hosting
Thank you, Arnold. I don't
Thank you, Arnold. I don't have time at the moment, but hopefully later today I can try that.
I want to be clear that I am doing this right....here's my current understanding: I see page.tpl.php file in the templates folder of my Zen directory. But I don't want to touch that, right? Because anything I do will get wiped if/when I update the theme? So I made a subtheme, and there's nothing in the templates folder right now. Do I want to copy the whole page.tpl.php from my main Zen folder, and just add the PHP snippet to that?
yes
Yes, That is exactly the idea. And to be clear, my css solution was the quick and sloppy solution. The Big Picture pages are still loading the header and then css is telling them not to display it. The "right" solution will be to either add logic into the page.tpl.php as above OR add a custom content type-specific page template.
A list of some of the Drupal sites I have designed and/or developed can be viewed at motioncity.com
Still working on this...would
Still working on this...would love to do it the right way, but I'm just not hitting on it. Based on Arnold's suggestions, I added this code to page.tpl.php:
But I get the following errors:
Notice: Undefined variable: node in include() (line 121 of /home/holgaia/public_html/sites/all/themes/toddzen/templates/page.tpl.php).
Notice: Trying to get property of non-object in include() (line 121 of /home/holgaia/public_html/sites/all/themes/toddzen/templates/page.tpl.php)