Extra Body Classes

Synopsis

Extra body classes is a simple module which will provide extra classes on the <body> tag. This module will provide below functionality.

  1. Timestamp: This option will provide time stamp as a class <body> tag. ex. 20151007
  2. Year: This option will provide year as a class to <body> tag. ex. 2015
  3. Month: This option will provide month as a class to <body> tag. ex. october
  4. Day: This option will provide day as a class to <body> tag. ex. wednesday
  5. Current browser platform: This option will provide current browser platform as a class to <body> tag. ex. mac
  6. Current browser name and version: This option will provide current browser name and version as a class to <body> tag. ex. chrom chrom46
  7. Current device: This option will check whether current device is Desktop or Mobile and implement as a class to <body> tag. ex. Desktop
  8. Roles: This option will provide current user roles as a class to <body> tag. ex.authenticated administrator
  9. Single Day Event: This option will provide custom single day event classes to <body> tag. ex. independence-day
  10. note: This class will be removed once single day event is over.

  11. Multiple Day Event: This option will provide custom multiple day event classes to <body> tag. ex. drupal-con-asia
  12. note: This class will be removed once multiple day event is over.

  13. Custom Classes Based On Path: This option will provide custom classes to <body> tag based on path. ex.node/1, about-us

How to use it

  1. After download place unzipped folder in YourProjDir/modules/contrib directory
  2. Go to admin/modules and enable it.
  3. For configuration go to admin/config/content/extra-body-classes check options and save it
  4. Output: <body class="20151014 2015 october wednesday .......>

Credits

Rahul Baisane (rahulbaisanemca) - https://drupal.org/u/rahulbaisanemca

Dependencies

This module will not be depend on any other contributed module.

Supporting organizations: 
Sponsored the development
Drupal 9 release and maintenance

Project information

Releases