Le filtre |extraire_attribut{nom_attribut} (depuis SPIP 1.8.2) permet de récupérer l’attribut précisé d’un tag html.
Par exemple :
si la balise #LOGO_SITE_SPIP génère le code html <img width="353" height="120" style="height: 120px; width: 353px;" class="spip_logos" alt="SPIP" src="local/cache-vignettes/L353xH120/siteon0-1de24.jpg"/>,
alors :
-
[(#LOGO_SITE_SPIP||extraire_attribut{src})]retourneralocal/cache-vignettes/L353xH120/siteon0-1de24.jpg -
[(#LOGO_SITE_SPIP||extraire_attribut{width})]retournera353 -
[(#LOGO_SITE_SPIP||extraire_attribut{style})]retourneraheight: 120px; width: 353px;
