|extraire_attribut

O filtro |extraire_attribut{nome_atributo} permite recuperar um atributo de uma tag HTML.

  • Apparu en : SPIP 1.8.2

Exemplo:

Se a tag #LOGO_SITE_SPIP gera o código HTML

<img width="353" height="120" style="height: 120px; width: 353px;" class="spip_logos" alt="SPIP" src="local/cache-vignettes/L353xH120/siteon0-1de24.jpg"/

então:

  • [(#LOGO_SITE_SPIP|extraire_attribut{src})] retornará local/cache-vignettes/L353xH120/siteon0-1de24.jpg
  • [(#LOGO_SITE_SPIP|extraire_attribut{width})] retornará 353
  • [(#LOGO_SITE_SPIP|extraire_attribut{style})] retornará height: 120px; width: 353px;

Ver também

Autor Ricardo Porto Publié le :

Traductions : català, English, Español, français, Nederlands, Português