Top Banner
Drupal Marco Torres Rodríguez Softwin Perú
18

Drupal - theming (tips)

Dec 05, 2014

Download

Technology

Mco Torres

En esta oportunidad explico algunas maneras de poder hacer un tema en Drupal, doy varios consejos por la experiencia que tengo trabajando con este CMS durante varios años. Muy agradecido por la experiencia en Drupal, es que decidí publicar algunos tips(consejos) de como manejar las diferentes funcionalidad, herramientas, que te ofrece Drupal al momento de hacer un tema personalizado.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Drupal - theming (tips)

Drupal

Marco Torres RodríguezSoftwin Perú

Page 2: Drupal - theming (tips)

¿QUÉ ES UN TEMA?

Un Tema (theme) es una serie de archivos que define la capa de presentación (el look and feel) de una web con Drupal. Un tema especifica la estructura de la página.

Drupal(Theming)

Page 3: Drupal - theming (tips)

HERRAMIENTAS ÚTILES

● Aptana / Vim (multiplataformas)

● Firebug de Firefox

● Inspector de Chromium o Google Chrome

Drupal(Theming)

Page 4: Drupal - theming (tips)

MÓDULO DEVEL

Es un paquete de módulos con herramientas muy útiles para desarrolladores Drupal.

Drupal(Theming)

Page 5: Drupal - theming (tips)

MÓDULO THEME DEVELOPER

Es un módulo que ayuda a los creadores de temas, dando información sobre: hook que se utiliza, template, nombres de los templates que se podrían usar, funciones preprocess y lista de variables disponibles.

Drupal(Theming)

Page 6: Drupal - theming (tips)

ESTÁNDAR DE CÓDIGO

http://drupal.org/coding-standards

Drupal(Theming)

Page 7: Drupal - theming (tips)

RECORDEMOS LAS ENTIDADES EN DRUPAL 7

● Nodes (Nodos)

● User (Usuarios)

● Taxonomy terms (Términos de Taxonomía)

● Comments (Comentarios)

Drupal(Theming)

Page 8: Drupal - theming (tips)

TEMPLATES (.tpl.php)

Drupal(Theming)

Page 9: Drupal - theming (tips)

TEMPLATES (.tpl.php)

Drupal(Theming)

Page 10: Drupal - theming (tips)

PROCESO DE CREACIÓN DE UN TEMA

Se debe contar con los diseños necesarios, los que definan la estructura del sitio web. De acuerdo a los diseños se definirán las regiones, bloques y vistas.

Drupal(Theming)

Page 11: Drupal - theming (tips)

FUNCIÓN l()

Para imprimir hipervínculos (enlaces)l($text, $path, array $options = array($attributes, $html, $language))

Drupal(Theming)

Page 12: Drupal - theming (tips)

REGIONES EN PAGE (.tpl.php)

Condicionar la visibilidad de regiones si estas almacenan contenido.

Drupal(Theming)

Page 13: Drupal - theming (tips)

PÁGINA Y NODO

Tomar en cuenta las clases que generan cada página o nodo dentro de ella.

page-type-node, page-pagename, node, node-id, etc

Drupal(Theming)

Page 14: Drupal - theming (tips)

VISTAS

Tomar en cuenta las clases que generan o podemos generar en las listas de vistas.

view, view-row-odd, view-row-even, pager, etc

Drupal(Theming)

Page 15: Drupal - theming (tips)

FORMULARIOS

Tomar en cuenta las clases que drupal genera para campo o div padre del mismo.

form-text, form-checkbox, form-submit, etc

Drupal(Theming)

Page 16: Drupal - theming (tips)

BLOCK CLASS

Es un módulo muy práctico y sencillo que nos permitirá declarar clases para cada bloque que deseémos. De esta manera, evitamos generar archivos .tpl.php dando un mejor rendimiento al sitio web.

Drupal(Theming)

Page 17: Drupal - theming (tips)

ESTILOS PARA ETIQUETAS HTML

Definir un archivo para todas las etiquetas html y clases estándares de drupal.

Drupal(Theming)

Page 18: Drupal - theming (tips)

Drupal(Theming)

[email protected] Perú