Closed (outdated)
Project:
Drupal core
Version:
6.14
Component:
theme system
Priority:
Minor
Category:
Task
Assigned:
Reporter:
Created:
1 Dec 2009 at 17:16 UTC
Updated:
2 Mar 2016 at 22:18 UTC
Jump to comment: Most recent
Hey, I have a little problem with my current project.
I have image bound to each node of custom type and I need to change BODY background to this image after i view this node.
I know that i can do such thing with editing node-mycontent.tpl.php like this:
<div class="content clear-block" style="background: #000 url(<?php print $node->field_image[0]['filepath'] ?>) top right no-repeat">
but it dosen't work with page.tpl.php in BODY section eg.
<body style="background: #000 url(<?php print $node->field_image[0]['filepath'] ?> top right no-repeat">)
I would appreciate quick response. THX.
Comments
Comment #1
mist commentedI found rather brute force and leaky solution:
I use this code
before BODY is build.
I will not work with friendly urls. Is there any other way to do it ?