Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.
I have a question about the body classes on Drupal:
- How do I add a class in body tag based on users permissions? For example: If the user has the role "editor", any page that he views will appear in body tag a class like "logged-role-editor" or "logged-role-editor-user-nameoftheuser".
- Do I have to put some code in template.php? If so, can you post it?
Hi,
I am having trouble editing the User fields when you go to login (for example admin) there is a template that shows forms that you can edit your information, how do I edit the template on which these forms are in?
Which file in drupal directory is displaying the page when you are in "http://www.website.com/?q=user" < i need to know how to edit this template or tag or i have know idea what is controlling this page.
On my Drupal website, I created a role, called "editor". When a user with this role logs in, he can see the toolbar + shortcuts bar.
The problem is in his role, he doesn't need any links in the toolbar except of the "home icon" and "Content". In the shortcut bar, there are 6 shortcuts links.
Now. I think it's a bit stupid to use 2 bars because all the information can be collected into 1 bar. Is there a way to disable the toolbar but keep the shortcuts bar or collecting the two of them?
I am trying to solve a problem related to adding div css classes in innermost div.
I tried the following code also
function THEMNAME_preprocess_html(&$variables) {
$variables['classes_array'][] = 'my-new-body-class';
}
but it adds class only in body tag.
Actually I want to add css class into a view, I edited the view and added the css class there, but it only added a class in outer most div only.So can any one help me on this issue.