Soumis par ikino le lun 15/10/2018 - 08:54

    Changed theme without drupal appearance menu

    bhargav.addweb commented 

    Using below mentioned content you can change theme without using drupal appearance menu :

    1.) Change the active theme with Drush :

    => For Drupal 7 :

    drush vset theme_default garland

    => for Drupal 8 (Drush 7+) :

    drush config-set system.theme default bartik

    If drush fails with an error than install drush using following command:

    -> To install drush without composer

    sudo php -r "readfile('');" > drush \
    && sudo chmod +x drush \
    && sudo mv drush /usr/local/bin

    -> To install drush with composer; it will install latest version of drush

    composer global requie drush/drush

    2.) Change the active theme using the database :

    The default theme setting is stored in Drupal's database, and this can be changed by manipulating the database from the command line or an administration overlay or client like PHPMyAdmin or MySQL Workbench for MySQL.

    Always make a backup of your database before changing values in it directly, as it is possible to destroy data and render your site unrecoverable at the database level. You have been warned.

    In Drupal 7, the setting is stored in the system table:

    => Activate a trusted theme

    UPDATE system SET status=1 WHERE name = 'garland';

    => Change the default setting

    UPDATE variable SET value='s:7:"garland"' WHERE name = 'theme_default';

    And clear the cache tables

    TRUNCATE cache;
    TRUNCATE cache_bootstrap;
    TRUNCATE cache_block;

    If you are using per-user themes, and you've just messed it up for yourself as admin 

    UPDATE users SET theme='garland' WHERE uid = '1';

    In Drupal 8, the setting is in the  config table, and stored as a blob value for system.theme.