Site building

18
Drupal Site building Osvaldo Villarroel Marañon [email protected]

description

Introducción a construcción de sitios en Drupal.

Transcript of Site building

Page 1: Site building

DrupalSite building

Osvaldo Villarroel Marañ[email protected]

Page 2: Site building

¿Site building?Implementar funcionalidad y características en un sitio Drupal.

Page 3: Site building

Para ingresar al mundo Drupal1. Crear una cuenta en: http://www.drupal.org2. Ingresar a los grupos de tu interés en:

http://groups.drupal.org/http://groups.drupal.org/bolivia

3. Donde aprendera. Las reuniones de la comunidad.b. Los manuales oficiales: http://drupal.

org/documentation

Page 4: Site building

Tecnologías involucradas

Page 5: Site building

Construir un sitio drupal¡Es un juego!

Page 6: Site building

Que!!!!

Page 7: Site building

Módulo = Pieza de lego

Page 8: Site building

Estructura de archivosLos nuevos módulos se montan en sites/all/modules

Los nuevos temas se montan en sites/all/themes

Page 9: Site building

Módulos contribuidos para comenzar● Fields.

Los tipos de contenido (Nodos) pueden tener cualquier contenido.● Views.

Representa contenido de la base de datos en un formato que puede ser: lista, bloques, tablas o cualquier cosa que nos imaginemos.● Module filter, admin menu.● Una lista de módulos recomendados:

http://groups.drupal.org/node/147614

Page 10: Site building

Montando mi primer sitio Drupal1. Instalar drush.

Ubuntu/Debian sudo apt-get install drushWindows: http://www.drush.

org/drush_windows_installer2. Descargar drupal desde la consola drush

drush dl --drupal-project-rename=drupalizado drupal 3. Instalar drupal desde la consola drush

drush site-install --db-url=mysql://usuario:clave@localhost:3306/bddrupalizado \--site-name=Drupalizado standard

Page 11: Site building

Creando un primer módulo1. Crear archivo de información del módulo

hello_world.info2. Crear archivo que contiene la interacción del

módulo con Drupalhello_world.module

Page 12: Site building

hello_world.infoname = Hello worlddescription = Simple Hello world message.package = Basic Examplesdependencies[] = menucore = 7.x

Page 13: Site building

hello_world.module<?php

/**

* Implementation of

hook_help().

*/

function hello_world_help

($section) {

switch ($section) {

case

'admin/help#hello_world':

$output = '<p>Hello world

help...</p>';

return $output;

case

'admin/modules#description':

return 'Hello world module

description...';

}

}

/**

* Implementation of hook_menu().

*/

function hello_world_menu($may_cache) {

$items = array();

if ($may_cache) {

} else {

$items[] = array(

'path' => 'hello', // example.com/?q=hello

'title' => 'Hello world page...', // page title

'callback' => 'hello_world_page', // callback

'access' => TRUE, // user can look

'type' => MENU_CALLBACK // define type of

menu item as callback

);

}

return $items;

}

/**

* Function which

generate page (this

generate any content -

you need only your

own code...)

*/

function

hello_world_page() {

return '<p>Hello

world!</p>';

}

?>

Page 14: Site building

Módulos contribuidos avanzados● Rules.● Panels.● Display suite.● Commerce.● Organic groups.● Context.● Internationalization.● Pathauto.● Webform.● Features.

Page 15: Site building

¿Entendiste todo?

Page 16: Site building

Theming1. Definir un mockup.

(Diseño)2. Escribir los archivos de

funcionalidad:a. my_theme.infob. page.tpl.phpc. ...

3. Escribir los estilos *.css4. Escribir las operaciones

o efectos *.js

Page 17: Site building

Referenciashttp://drupal.org/documentation/buildDocumentación oficialhttp://www.fotopedia.com/Fotgrafíashttp://drupal.org/node/84658Hello worldhttp://drupal.org/node/1843176Instalación drush en windows