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

  • Home
  • SEARCH
  • 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 759839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:38:42+00:00 2026-05-14T15:38:42+00:00

drupal version is 6. just want to know where are those $body_classes comes form.

  • 0

drupal version is 6. just want to know where are those $body_classes comes form.

I knew in template_preprocess_page , there is a variable called ‘body_classes’.

but my problem is, not all body_classes are come from preprocess page.

for instance:

I have a term named ‘activities and attractions’, then in my page.tpl.php, there is a class
‘page-activities and attractions’ in my tag. looks like taxonomy module generates a body_class, but i could find it after search seource code of taxonomy module.

  • 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-05-14T15:38:43+00:00Added an answer on May 14, 2026 at 3:38 pm

    A module (such as taxonomy) generally does not override page template variables. Though it could be done by providing custom preprocess functions in hook_theme_registry_alter(). (See the context module for example)

    The class ‘page-activities-and-attractions’ is most likely coming from template_preprocess_page() in includes/theme.inc on line 1894

    $body_classes[] = preg_replace('![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s', '', 'page-'. form_clean_id(drupal_strtolower(arg(0))));
    

    This adds a body class for the first part of the drupal path.
    For example, the path “node/1” would have a body class “page-node” and the path “taxonomy/term/1” would have a body class “page-taxonomy”.

    If you have a path “activities-and-attractions” (maybe from the page display of a view?) then you will get a body class “page-activities-and-attractions”.

    Note: This uses the internal Drupal path not url aliases. The alias “content/mypage” may really be “node/12” internally so the body class will be “page-node” not “page-content”.

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

Sidebar

Related Questions

Drupal Aggregator core module is a useful one but suffers many problems. There are
Does drupal have a simple version for reading like drupal_write_record . I want to
Drupal is very much a Do Everything CMS. There are modules that allow you
I'm running Drupal 5 on my website and want to upgrade to V6. I've
I have a Drupal module page where I am populating a form with a
If all CMS's (Drupal, MediaWiki) are just a collection of PHP or ASP in
Drupal version 6.12 I have a page whose input format is PHP. I simply
I want to use the Brilliant Gallery (Drupal) to show a public Picasa album.
My drupal site (internal) will not display the TinyMCE editor when using Google Chrome
I have Drupal 5 site where a button is clicked and it calls 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.