Porting a Drupal 7 module to Drupal 8 (a real life example) #5- css and js modifications

Drupal 8’s beta version was released a few month ago and now it is time to start porting modules. To demonstrate how to do it, we’re going to use a real module called scroll_to_top, which allow us to scroll to top when we are reading an article and we want to go to the menu for example.

If you prefer watching videos, here is the screencast version of this series.

In this chapter of the series we are going to make some bit changes in the css and javascript scripts that our module brings in the Drupal 7 version.

Sigue leyendo

Anuncios

Drupal 8: La iniciativa del Administrador de Configuraciones (Configuration Management)

Introducción

En Drupal 7 no siempre es claro si algo pertenece a la “configuración” o al “contenido”. Son los vocabularios configuraciones? Son los términos de la taxonomía configuraciones? Y qué decir de un término de la taxonomía cuyo ID se utiliza como filtro contextual en una vista?

Otro molestoso problema con Drupal 7 es que los módulos son libres de establecer sus propias normas para el almacenamiento de valores de configuración, por lo que es común encontrar sitios donde la configuración se esparce entre las variables, tablas de bases de datos, a través de los objetos exportados con CTools, Features, y otros lugares. Módulos como Features a veces necesitan un poco de “magia negra” para adivinar dónde y qué tan relevante configuración se almacena.

Inspirado por estas cuestiones, la comunidad de Drupal comenzó una iniciativa, en concreto la iniciativa “Configuration Management” que ha estado trabajando para resolverlos y gracias a esto tenemos ahora una manera fácil de trabajar con un gran sistema de configuración.

En Drupal 8, la configuración es menos subjetivo: Drupal tiene una función “Exportar configuración” que exporta toda la configuración del sitio (y por supuesto, usted puede “Importar configuración” para implementarlos en otro sitio con facilidad); si hay algo que no está ahí, no se considera que es un parámetro de configuración. Y con esto, está claro que forma parte de la configuración y que no. 🙂

Sigue leyendo

Drupal 8 Configuration Management Initiative

Introduction

In Drupal 7 it isn’t always clear-cut whether something belongs in the “configuration” or “content” realm. Are vocabularies configuration? Are taxonomy terms configuration? And what about a taxonomy term whose ID is used as a contextual filter in a View?.

Another annoying issue with Drupal 7 is that modules are free to set their own standards for storing configuration, so it is common to find sites where configuration is scattered among variables, database tables, objects exported via CTools, Features, and other places. Modules like Features at times need some “black magic” to guess where and how relevant configuration is stored.

Inspired by this issues, Drupal community started an initiative, specifically the Configuration Management Initiative that have been working to solve them and thanks to this we have now an easy way to work with a great configuration system.

In Drupal 8, configuration is less subjective: Drupal has an “Export Configuration” function that exports all the site configuration (and of course you can “Import Configuration” to deploy them in another site easily); if something is not there, it is not considered to be configuration. And with this, it’s clear what is configuration and is not. 🙂

Sigue leyendo

Porting a Drupal 7 module to Drupal 8 (a real life example) #4- making it work (almost)

Drupal 8’s beta version was released a few month ago and now it is time to start porting modules. To demonstrate how to do it, we’re going to use a real module called scroll_to_top, which allow us to scroll to top when we are reading an article and we want to go to the menu for example.

If you prefer watching videos, here is the screencast version of this series.

In this chapter of the series we are going to make our module work by adding correctly css and javascript files that its need to show up the button when the user scroll down.

Sigue leyendo

Porting a Drupal 7 module to Drupal 8 (a real life example) #3- configuration form

Drupal 8’s beta version was released a few month ago and now it is time to start porting modules. To demonstrate how to do it, we’re going to use a real module called scroll_to_top, which allow us to scroll to top when we are reading an article and we want to go to the menu for example.

If you prefer watching videos, here is the screencast version of this series.

Drupal modules often provide an administrator with a settings page so that various configuration options can be tuned and setup using the web interface. In this chapter we are going to explore to create a configuration form and save values in the configuration management.

Sigue leyendo

Porting a Drupal 7 module to Drupal 8 (a real life example) #2- menu links and routing

Drupal 8’s beta version was released a few month ago and now it is time to start porting modules. To demonstrate how to do it, we’re going to use a real module called scroll_to_top, which allow us to scroll to top when we are reading an article and we want to go to the menu for example.

If you prefer watching videos, here is the screencast version of this series.

In Drupal 7, hook_menu() was probably the most implemented hook because it was used to define paths to Drupal and connect these paths with callback functions. It was also responsible for creating menu links and a bunch of other stuff, but they were replaced and in this second chapter we’re going to see how to port it.

 

Sigue leyendo

Porting a Drupal 7 module to Drupal 8 (a real life example) #1- kicking off

Drupal 8’s beta version was released a few month ago and now it is time to start porting modules. To demonstrate how to do it, we’re going to use a real module called scroll_to_top, which allow us to scroll to top when we are reading an article and we want to go to the menu for example.

If you prefer watching videos, here is the screencast version of this series.

 

Sigue leyendo

Gear Framework. Aclaraciones

Back-end pensando en el Front-end

Hoy nos gustaría presentarles el proyecto en el cual estamos trabajando, llamado Gear Framework, está presentación es un poco informal, ya luego estaremos lanzando la documentación en el cual si intentaremos ser seremos mas serios.

Se trata de un framework que nace de un divague entre amigos el cual hace que la programación se separe 100% del diseño, lo que permite que estos pilares trabajen de manera independiente uno del otro, y así poder proporcionarle al diseñador la total libertad para hacer volar su imaginación y de esa manera crear sitios más usables y accesibles.
Sigue leyendo