¿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.
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).
- Desactivar tema:
drush -l http://example.com/ pm-disable theme_name
- Habilitar tema:
drush -l http://example.com/ pm-enable theme_name
- Cambiar tema:
drush -l http://example.com/ vset theme_default theme_name
- Cambiar el tema del administrador:
drush -l http://example.com/ vset admin_theme theme_name
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
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
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
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.
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
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
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