Es mostren els missatges amb l'etiqueta de comentaris themming. Mostrar tots els missatges
Es mostren els missatges amb l'etiqueta de comentaris themming. Mostrar tots els missatges

dimecres, 20 de març del 2013

Un bon apunt per a gent amb poca memòria ;)

Theming a Node in Drupal...The Easy Way
Es tracta d'una mena d'apunts on recorda la forma de "tunejar" plantilles (o thems) a drupal. Al igual et sorprèn alguna forma ;)
En resum:

  1. Copy the existing node.tpl.php file (if you only want to move a few things around) and rename it to node-custom.tpl.php, the "custom" part is the machine readable name you gave your node.
    For example: a blog entry would be node-blog.tpl.php
  2. The other way is to simply make a new text file on your computer and name it node.tpl.php, this will give you a completely blank canvas to work with.
I si volem crear un tpl.php de zero també us semblarà per veure com "imprimir" al nostre web les diferents parts d'informació de cada node


Example: Theming a Specific CCK Content Type

O com afegir camps de CCK a les nostres plantilles de Drupal.
Tot l'article a: http://drupal.org/node/266817
Per a tunejar camps de data la cosa es complica i m'ha tingut mitg mati ben ocupat..


<code>
<?php echo $node->field_date_hour[0]['view'];?><br /> (format per defecte de Drupal)
 <br /><?php echo date('d M',strtotime($node->field_date_hour[0]['value'])); ?> (Imprimir només dia i mes abrebiat)
<br /><?php echo date('h:i',strtotime($node->field_date_hour[0]['value'])); ?> (imprimir hora i minuts)
</code>
Extret de: http://drupal.org/node/675268