I have got a question. I have got drupal 7 running and in the user profile page, the body classes look like this:

<body class="html not-front logged-in one-sidebar sidebar-first page-user page-user- page-user-1">

If you notice, the second last class, 'page-user-' seems like it is missing something at the end, meaning, something is not working right. I have used theme devel and just did some mega digging around (including the user module) to see where this class is being added from, but I have had no luck.

I would basically like to change the styling of some tables in the user profile page via css and would like to identify these tables by a specific class in the body, so that it only applies in this user profile page. If that class was perhaps displaying correctly, I could identify the tables with that, and not have to modify the user-profile.tpl.php page to add a new class. So, I would appreciate it if anyone could tell me where these classes are being added, and what that missing variable could possibly be. Thanks.

  • which theme do you use? your own or an existing? Feb 22, 2013 at 7:57
  • My own theme....
    – SN_26
    Feb 22, 2013 at 9:40

2 Answers 2


Drupal add arguments to page classes to make it possible to theme the page depending on the current page type (e.g. node, admin, user, etc.) as well as more specific data like node-12 or node-edit.

  • I actually know how to add a new body class to the user-profile page, (by adding the class to user-profile.tpl.php and adding it to my theme folder) however, my concern is this .page-user-, which looks like it is missing something at the end, and that makes me wonder if something is going wrong somewhere. If that was working correctly, maybe, I don't need to add a separate class of my own and can just use that class, so I could do without adding the user-profile.tpl.php file to my theme.
    – SN_26
    Feb 25, 2013 at 5:31

The solution/or answer to this question lies here:


Thanks def-gie for the answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.