Abi أب
  • Member for 9 years
  • Last seen this week
Remove Administration Theme from user/%/edit
Accepted answer
11 votes

For Drupal 7 you can use Administration theme or hook_admin_paths_alter() in your custom module. /** * Implements hook_admin_paths_alter(). */ function my_module_admin_paths_alter(&$paths) { $...

View answer
Removing field wrapper in a form
Accepted answer
7 votes

You can set #theme_wrappers of the element to empty array so the element will not have any wrapper at all. $form['email']['#theme_wrappers'] = array();

View answer
How can I add a CSS class to all the tables?
5 votes

If your table is rendered using theme('table'), you can preprocess it from your theme function. function my_theme_preprocess_table(&$variables) { $variables['attributes']['class'][] = 'table'; }...

View answer
Log a user in manually, get session?
1 votes

For general entity, yes you can use entity.manager service. For user entity, you can use \Drupal\user\Entity\User. However in your case, you are going to load user by username, this can't be done by ...

View answer
How can can I get theme callback to work for an error page?
0 votes

In menu_get_custom_theme(), you can see that theme callback on menu router would not be called if the menu router doesn't exist. But you can achieve that with hook_custom_theme(). I'll go like this: ...

View answer
I have some difficulties with page.tpl.php
0 votes

If you override page.tpl.php, your other page will be overriden too. If you want to override specific page, consult Drupal 7 Template (Theme Hook) Suggestions. In your case, you can: Create page--...

View answer