drupal-6


drupal body class


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.
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".

Related Links

How do I change the user/password page on Drupal
using custom CCK fields in node + Drupal 6 for some reason not accessible by $node ->field_name
Block a specific page in Robots.txt
How to copy Drupal website to localhost from Server
Declaring function in Blocks in Drupal 6
How to add additional SUBMIT handler when a FILE is uploaded on Drupal
How to display all taxonomy terms as tree view in block drupal 6?
Drupal 6 not loading page-user.tpl.php file
Not able to add fields to my content type in Drupal 6
How do i overwrite the default drupal6 block template?
how to add a sum field in a view?
How can Block direct access to drupal 6 site
how to clear varnish cache for a drupal view?
Drupal 6- 404 is not showing for menu item URL pattern implemented using hook_menu
hook the function in module in drupal
Conditional Field is not working with content_multigroup, cck , drupal

Categories

HOME
log4j
testng
atom-editor
pypi
gerrit
openstack
mockito
nullpointerexception
hp-exstream
dxl
nano-server
google-apps-marketplace
google-cloud-spanner
designer
solaris-10
google-cloud-speech
lucene.net
autocad-plugin
one-hot-encoding
wijmo
rundeck
kannel
neo4j-spatial
buck
windowbuilder
delicious-api
fabric8
semantic-versioning
caret
protovis
openoffice.org
android-nestedscrollview
rotational-matrices
plsql-psp
stacked
jna
eclipse-scout
elmah
janrain
eigenvalue
unixodbc
logfiles
menuitem
magma
google-perftools
knpmenubundle
mako
hittest
mediaelement
fuzzy-search
ios4
revolution-r
rtbkit
deis
twirl
apache-commons-net
xcode-6.2
rdl
bitcoinj
fmod
uv-mapping
floating-point-precision
page-layout
inbox
jmapviewer
spring-io
apc
xamlparseexception
selected
path-separator
quickdialog
google-email-migration
chrono
code-cleanup
vdsp
coredump
floating
cxxtest
gin
nsviewanimation
virtual-functions
thread-local-storage
ubuntu-9.04

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App