SPIP

[ar] [ast] [bg] [br] [ca] [co] [cpf] [cs] [da] [de] [en] [eo] [es] [eu] [fa] [fon] [fr] [gl] [id] [it] [ja] [lb] [nl] [oc] [pl] [pt] [ro] [ru] [sk] [sv] [tr] [uk] [vi] [zh] Espace de traduction

Download

|extraire_attribut

July 2010 — updated on : December 2010

All the versions of this article:


The |extraire_attribut{attribute_name} filter (since SPIP 1.8.2) is used to retrieve the value of a specific attribute from an HTML tag.

For example:
Suppose that the #LOGO_SITE_SPIP tag (documentation here) generates the HTML code: <img width="353" height="120" style="height: 120px; width: 353px;" class="spip_logos" alt="SPIP" src="local/cache-vignettes/L353xH120/siteon0-1de24.jpg"/>,

In that case:

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

Show the template of this page Site powered by SPIP | Translation area | Private area