0

Im trying to create pages with a search bar in a specific non block area in Drupal 7. If I edit using Live CSS (or another module), it edits all my pages, and offsets the content I created. I need a way to edit the CSS styles for each individual page; in that way, I can edit the search form area, and have also a way to add my own button images.

I can disable Drupal regions/blocks, but that doesn't really help. May someone name some modules that could help, or suggest me some code?

2 Answers 2

4

Well the absolute simplest way is to look at the body class using firebug or developer tools with chrome.

You will see something like this:

<body class="html not-front logged-in no-sidebars page-node page-node- page-node-19 node-type-log-node admin-menu">

Which as you can see even has the node id for the page. Then its just a simple case of using

.page-node-19 {
background: #000000;
}

Or whatever!

And, if you want to get super in detail with adding stuff to certain pages, themes, regions, dependencies on which users etc etc then look into the context module and all its related modules.

2

The Context module, combined with the Panels module can be of great help.

You can hack also the master template a bit, inserting if/else statements, but hacking should be avoided as much as possible.

1
  • Context also places all of your tweaks in a single location. If you document the description well, editing later becomes easy.
    – Rick
    Commented Mar 1, 2013 at 14:31

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