Bloque de contenido expandible en Drupal

En Drupal es sencillo utilizar los bloques de contenido expandibles tal cual los vemos en los menús o en la interfaz de administración.

Para esto debemos definir un bloque con la etiqueta html del tipo <fieldset> y asignarle la clase css collapsible.

Para colocar este bloque en estado inicial de colapsado debemos asignarle también la clase css collapsed.

El texto que actuará como control para expandir o colapsar el bloque de contenido debe estar dentro de las etiquetas <legend>.

Código de ejemplo:

<fieldset><legend>Schema</legend><p>Introduced in Drupal 6, the Schema API allows modules to declare their database tables in a structured array (similar to the Form API) and provides API functions for creating, dropping, and changing tables, columns, keys, and indexes.</p><p>The Schema module provides additional Schema-related functionality not provided by the core Schema API that is useful for module developers. Currently, this includes:</p><p>    * Schema documentation: hyperlinked display of the schema's embedded documentation explaining what each table and field is for.<br />    * Schema structure generation: the module examines the live database and creates Schema API data structures for all tables that match the live database.<br />    * Schema comparison: the module compares the live database structure with the schema structure declared by all enabled modules, reporting on any missing or incorrect tables.<br /></p><p>Note for MySQL users: The Schema module requires MySQL 5. Prior versions of MySQL do not support the INFORMATION_SCHEMA database that the Schema module uses to inspect the database.</p></fieldset>

Debemos tener en cuenta la forma en la que afectan los cambios de línea. Para esto podemos desactivar el cambio de línea automático y valernos de la etiqueta html <br />