Timeline for how to change the background image based on the node (the hard way)
Current License: CC BY-SA 3.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Feb 16, 2012 at 17:34 | vote | accept | user379468 | ||
Feb 10, 2012 at 18:31 | history | edited | Clive♦ | CC BY-SA 3.0 |
deleted 61 characters in body
|
Feb 10, 2012 at 18:30 | comment | added | Clive♦ | Yeah that's a good point, I forgot you could still inject CSS in the node preprocess. Glad you got it sorted I'll updated the answer to reflect what you've found | |
Feb 10, 2012 at 18:28 | comment | added | user379468 | ok, so I just moved it to the mytheme_preprocess_page which actually simplified everything because the node object is already available, and since it's injecting the CSS it doesn't really matter where it is processed (see response below) I'm not really sure why the menu_get_object was not working .... I'm using D7 and Omega as a base theme thanks again! | |
Feb 10, 2012 at 18:17 | comment | added | Clive♦ |
That's strange...if you're on a node page menu_get_object() will always return that node as an object...is there any chance you're calling this from a non-node page? Just to clarify a node page is one whose path (not URL alias) is, e.g. node/123
|
|
Feb 10, 2012 at 18:10 | comment | added | user379468 | thanks for your promt response, that makes sense, however I'm have some trouble menu_get_object(); does not seem to be returning anything. I try to dpm(); the node object, but I get nothing .... any idea? | |
Feb 10, 2012 at 17:34 | history | answered | Clive♦ | CC BY-SA 3.0 |