Closed (fixed)
Project:
Omega
Version:
7.x-3.1
Component:
Feature Request
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
20 Jul 2012 at 09:52 UTC
Updated:
24 Jul 2012 at 15:44 UTC
Hi can someone help me in adding a body ID to the html. Like "body id="pid-home" class="html front not-logged-in no-sidebars " . So when views the pages the body tag will have the URl alias added as ID. This works by Default in Fusion. But would be great if Omega could add this.
Thanks
Comments
Comment #1
JSCSJSCS commentedIf you are using the context module, it is fairly straight forward:
http://drupaleasy.com/quicktips/using-context-module-set-body-classes
Otherwise, you will need to code it in the template file, separate module or modify the .tpl files.
Comment #2
chrisjlee commentedAlso, if you're using context it may just be easier to load your files based on the page with context add assets rather than hard coding a body id:
http://drupal.org/project/context_addassets/
Comment #3
vishusrinivasan commentedThis might help:
1. Copy the html.tpl.php from the omega core templates folder to templates folder of your subtheme.
2. Edit the html.tpl.php and add ID like below for the body tag
<body<?php print $attributes;?> id="<?php print $body_id; ?>">3. Create preprocess-html.inc in the preprocess folder of your subtheme and add the following code and clear the cache.
Hope it helps.
Comment #4
rohith122 commentedthanks for your replies. @vishusrinivasan, that worked perfectly thanks
Comment #5
chrisjlee commentedComment #5.0
chrisjlee commentedremoved html tags from message