¿Qué es el comando drush para cambiar un tema en Drupal 7?


¿Cuál es el comando drush para cambiar un tema en Drupal 7?

drush theme disable theme_name
drush theme enable theme_name

No funciona.

 37
Author: batigolix, 2011-01-18

7 answers

Echa un vistazo al comentario en http://drupal.org/node/530780#comment-2513534 que tiene los últimos comandos relacionados con temas (en realidad, a partir de 3.0, pero parecen funcionar con Drush 4.x también).

 58
Author: sillygwailo,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-04-16 17:24:32

Puedes usar:

  • drush vset theme_default THEMENAME
  • drush vset admin_theme THEMENAME

Por ejemplo:

drush vset theme_default bluemarine 
drush vset admin_theme shiny

Estos configurarán los temas por defecto y admin del sitio, respectivamente.

Por supuesto, ambos deben estar habilitados, preferiblemente de antemano.

Compruebe que las cosas están configuradas de la manera que desee usando:

  • Drush status lists lista los temas predeterminados y de administración actuales

  • En Drupal 6 - drush pml / fgrep-e themes check para comprobar el estado de cada tema (Habilitado, Deshabilitado, etc.)

  • En Drupal 7- Tema drush pml | fgrep-e

 23
Author: Bob Newby,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-04-16 17:24:18
drush dl theme_name

El comando anterior descarga el tema.

drush en theme_name

El comando anterior habilita el tema.

Ahora, para establecer el tema habilitado como tema predeterminado, use el siguiente comando.

drush vset theme_default theme_name
 6
Author: batigolix,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-04-16 17:34:27

Drupal / Drush 8

La tabla variables ha sido reemplazada por la tabla config en Drupal 8, por lo que el comando drush vset ya no funcionará. Para Drupal8 / Drush8 use lo siguiente para establecer el tema predeterminado:

drush config-set system.theme default THEME_NAME

Y lo siguiente para establecer el tema admin:

drush config-set system.theme admin THEME_NAME
 5
Author: Adam Balsam,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-09-11 17:18:07

Esto te mostrará los temas que tienes:

$ drush pm-list --type=theme

Salida:

Nombre del paquete Estado Versión

Core Bartik (bartik) Habilitado 7.25 + 1-dev

Core Garland (garland) Desactivado 7.25 + 1-dev

Núcleo Siete (siete) Desactivado 7.25 + 1-dev

Núcleo Stark (stark) Desactivado 7.25 + 1-dev

Otro ASU WebSpark Bootstrap (openasu_bootstrap) Deshabilitado 7.26-dev

Otro Danblog (danblog) Deshabilitado 7.x-1,0

Otro Danland (danland) Habilitado 7.x-1,0

Otro Kalatheme (kalatheme) Deshabilitado 7.x-1,4

Otros Kanji (kanji) Desactivados 7.x-3,5

Otro Bartik sensible (responsive_bartik) Desactivado 7.x-1,0-beta2

Other theme700 (theme700) Habilitado 7.x-1,0

Y

$ drush vset theme_default bartik

Cambiará tu tema a Bartik.

 4
Author: Mauro,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-01-04 04:32:17

Para conocer el tema actual en el sitio mover dentro del directorio raíz del proyecto y luego

drush status theme

El comando anterior le indicará el tema actual establecido como predeterminado para el sitio y el administrador

Ahora cambie el tema predeterminado del sitio usando el siguiente comando (use el nombre del tema de su elección)

drush vset theme_default garland

El comando anterior hará que garland sea el tema predeterminado del sitio

Ahora cambie el tema predeterminado de admin usando el siguiente comando (use el nombre del tema de su elección)

drush vset admin_theme garland

El comando anterior hará garland como tema de administración predeterminado

 3
Author: Mrityunjoy Marial,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-04-16 17:15:49

Órdenes Drush para el cambio específico

drush vset theme_default THEMENAME
drush vset admin_theme THEMENAME

Por ejemplo:

drush vset theme_default bird
drush vset admin_theme fly

Estos configurarán el tema de administración del sitio

Ajustes para Drush

drush status -- enumera los temas predeterminados y de administración actuales

En Drupal 7 - drush pml | fgrep -e Theme

 1
Author: Iti Jha,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-10-08 07:43:28