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

|lignes_longues

July 2010 — updated on : June 2010

All the versions of this article:


The |lignes_longues filter, (since SPIP 1.9), inserts hyphens into words that ar "too long", by inserting breakable spaces into them allowing them to drop to the next physical line (useful, for example, to display URLs in a narrow column).

So, if the #TEXTE of an article contains a link like:

<a href="http://www.spip.net/spip.php?page=recherche&recherche=long_lines">http://www.spip.net/spip.php?page=recherche&recherche=long_lines</a>

then

<p style="width:30px;">
[(#TEXTE|lignes_longues{20})]
</p>

will display this as

http://www.spip.net
/spip.
php?page=recherche&
recherche=long_lines

Note that the hyphen maintains the HTML tags; in the example above, all of the link is clickable as can be seen in the HTML source.

By default, this filter cuts off at 70 characters, but you can specify another cut-off length by passing a parameter to the filter, e.g.
[(#TEXTE|lignes_longues{40})].


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