Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9241521
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:23:08+00:00 2026-06-18T08:23:08+00:00

I haven’t quite the right process to change the body classes based on the

  • 0

I haven’t quite the right process to change the body classes based on the page being viewed.

I have about 20 or so pages within a subsection that all have a different background color and reversed nav links from the main site.

I can’t figure out if there is some kind of preprocess function to use (and which) in template.php or if I should do something specifically in the certain xx-page.tpl.php file.

Just adding an ID to the body tag in the xx-page.tpl.php isn’t reliable due to browser caching.

I’ve seen this snippet:

if (drupal_is_front_page()) {
 $vars['body_class'] .= ' home';
 }

however, “is it the front or not” isn’t enough because it’s also not just a page, it’s a specific page but I’ve either missed the syntax or am doing something wrong.

Is this a case where I need to create a custom function and if so, is the template.php page where it goes?

also, I’m in Drupal 6.26

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T08:23:08+00:00Added an answer on June 18, 2026 at 8:23 am

    Are you looking for this function?
    http://api.drupal.org/api/drupal/includes!theme.inc/function/template_preprocess_page/6

    You might also want to have a look at the Context module.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I haven't designed a website for about 3 years now, so I am quite
Haven't seen anything about it here but it seems to solve one of the
Haven't done as much of Javascript as I should have done. I am trying
I have a small JavaScript validation script that validates inputs based on Regex. I
this is what i have right now Drawing an RSS feed into the php,
Haven't seen anything, but I have seen that you can create albums in the
I haven't been able to find documentation that talk about how create.js.erb and destroy.js.erb
I haven't actually dealt with multiple grids on one page in a very long
haven't used regex replaces much and am not sure if how I have done
Haven't seen this before so hopefully someone has a easy solve, I have a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.