drupal background different page classes

this is in my page.tpl.php

<body id="<?php print $body_id; ?>" class="<?php print $body_classes; ?>" >
  <div id="page" class="page">
    <div id="page-inner" class="page-inner">
      <div id="skip">

my drupal site has a repeating background image in body,
and a static image in page div

how do i render different page classes or ids for different nodes?
i want if im on music node, music page,    
this div becomes
<div id="page-music" class="page-music">
something like this, so i can have differnt static images on different node pages

i came across this
http://www.packtpub.com/article/dynamic-theming-in-drupal6-part1

seems like to make this happen
i can simply make a page-music.tpl.php

but i tried, drupal didnt seem to load the page-music.tpl.php even if i deleted the page.tpl.php




any ideas?
charmingduckAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Thomas4019Connect With a Mentor Commented:
I actually think your problem is normal, to quote a comment from this page, http://drupal.org/node/104316.

"Remember that these template suggestions are based on the default drupal path for a particular page. If you've used the path or pathauto module to hide them with url aliases, these templates will still be searched based on the original paths."

You're going to have to find a special way to make it use the url alias version.

Hmm, I'm now thinking using this module would be an easier solution, http://drupal.org/project/node_page.
0
 
Thomas4019Commented:
The easiest way to do this is via the URL. Make all the music pages be example.com/music/*. Then you can use a page-music.tpl.php. Use a different keyword for each page type.

Installing the Theme Developer module will tell you the possible template names for the page you are currently on.
0
 
charmingduckAuthor Commented:
I tried this already, but it didnt work, why??????????
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
Thomas4019Commented:
Maybe you need to flush your caches. Install the theme developer module and see what is suggests for template file names.
0
 
charmingduckAuthor Commented:
okay, im gonna try it
0
 
Thomas4019Commented:
sounds good, just make sure to disable it when you're done. (i.e. only have it enabled when you're debugging)
0
 
charmingduckAuthor Commented:
i saw this

template called:
page.tpl.php
candidate template files
page-node-143.tpl.php < page-node.tpl.php < page.tpl.php


what does it mean? this page is www.ex.com/music/shiens 

why is it that    there's no music    in the name of the template files?
0
 
Thomas4019Commented:
According to this, http://drupal.org/node/104316, it should have page-music.tpl.php. There must be something unique about your setup.
0
 
charmingduckAuthor Commented:
what could it be?
0
 
Thomas4019Commented:
This looks like it might have a solution, http://www.informit.com/articles/article.aspx?p=1336146&seqNum=7.
0
 
charmingduckAuthor Commented:
well, what can i say,

man, you are simply awesome

im gonna try this as well
0
 
charmingduckAuthor Commented:
great, node_page does work!!!!!!!!!!!!!!!!!!!!
0
 
Thomas4019Commented:
fabulous!, glad to help :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.