[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



August 2010

All the versions of this article:

The |lien_ou_expose filter returns either a clickable link or just a simple text title.

When applied to a given URL, the |lien_ou_expose{text_title, condition} filter will evaluate the condition and display either a link to that URL or just the text string that is passed as the first argument.

[(#URL_RUBRIQUE|lien_ou_expose{#TITRE, #ENV{test}|=={en_cours}})]
will display if there is a variable named "test" and its value is "en_cours" (in progress) in the current environment:
otherwise it will instead display just:


The filter also accepts 3 optional supplementary arguments "class", "title" and "rel".

[(#URL_RUBRIQUE|lien_ou_expose{#TITRE, #ENV{test}|=={en_cours}, spip_link, the best section, libraryentry})]

would then generate the following HTML source code (provided the condition evaluates to true):

<a href='-Title_of_the_section-.html' class='spip_link' title='the best section' rel='libraryentry'>Title_of_the_section</a>

otherwise it generates just:

<strong class='on'>Title_of_the_section</strong>

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