I am trying to custom theme a node for one of the pages. I changed its name to node--customname.tpl.php and it styled correctly, but it also brings that style to the front page. How can I keep the changes from displaying on the home page node. I only want it to display on the page itself such as www.mysite.com/custompage.

Thx

Comments

dawiyo’s picture

If I understand your situation correctly, I would give the body tag a separate class () and target the elements you want to change in your CSS file. For example: .custompage h1 {xxx}

krymp’s picture

The style makes it to the node and is still displayed on the front page.

nagarajanl’s picture

Try to add a sepeate body classes to the front page something like body-front and node pages like body-not-front and style it accordingly....

krymp’s picture

I am also updating the layout so I need to change the html. For example I am removing the user submitted info - print $submitted; on the node. I would like it to be removed on the page but not removed on the home page. Is there a specific way I can target a node in the page without affecting the node on the home page?

krymp’s picture

Is it possible that I am targeting the node wrong? Should I call the php page something else, like this "node--my_node--page.tpl.php"

nagarajanl’s picture

You can also try that...but as an alternate just add the following code in your node--my_node.tpl.php in order to display the submitted information only in the front page.

if (drupal_is_front_page()) :
   print $submitted;
endif
krymp’s picture

That worked an I can modify the page like that, but I was hoping to be able to directly edit page without putting php code around all the variables .

Thanks