I have few pages and need to add custom color and background image to every page and need to edit it from admin.

The best solution for me is adding custom variables in view or menu item. And then use it in page.tpl.php.

Is there any way to do it without a module?

  • you don't need to create a new module,, there is already one for you drupal.org/project/backgroundfield Commented Mar 22, 2015 at 19:32
  • I mean without using module, not creating :)
    – Narek
    Commented Mar 22, 2015 at 19:33
  • Do you have ctools and page manager installed?
    – Darvanen
    Commented Mar 23, 2015 at 0:13
  • @Darvanen ctools installed, page manager not, but if it helps I can try.
    – Narek
    Commented Mar 23, 2015 at 20:08
  • How about Panels? Have a look at this tutorial series, I found it really helpful.
    – Darvanen
    Commented Mar 23, 2015 at 22:22

1 Answer 1


ok let us try this ,,, maybe help

1- add new image field to your content type (background field)

2- open node.tpl.php in your theme

3- test if this node from this content type ,, then get the value of the background field image

4- do some thing to make this image url as a background

do the same with a little bit different for the styles :)

For Specific URL (this way maybe not professional):

1- create new content type (Backgrounds) with two fileds (URL + Image)

2- open page.tpl.php and write some php code can test if the current URL exists in any node from content type (Backgrounds)

3- if yes => get the image field and make it as background

  • Thanks for answer! Can this method be used for content list and not in content directly?
    – Narek
    Commented Mar 22, 2015 at 19:46
  • i couldn't understand you what do you mean 'content list' Commented Mar 22, 2015 at 19:49
  • List of items. if I have content type books then there will be page whee I have list of books.
    – Narek
    Commented Mar 22, 2015 at 20:18

Not the answer you're looking for? Browse other questions tagged or ask your own question.