#PETITION

-  #PETITION displays the text of the petition if its exists.

If the petition exists but the text is empty, the tag returns a space (a non-empty character string that does not have any impact on an HTML page). This makes it possible to test for the existence of a petition within an (ARTICLES) loop.

Using the example from the dist templates, the template file inc-petition.html is only included if the petition is activated for the article:

[(#PETITION|?{' '})<INCLURE{fond=inc-petition}{id_article}>]

A more elaborate example: we include the template file inc-petition.html, either if there are signatures OR if there is a petition. In fact, whenever we delete a petition using the private zone, in order to close the possibility of signing that petition, the preceding code also deletes the list of signatures.

<BOUCLE_signatures(SIGNATURES){id_article}{0,1}>
    <INCLURE{fond=inc-petition}{id_article}>
</BOUCLE_signatures>
    [(#PETITION|?{' '})
         <INCLURE{fond=inc-petition}{id_article}>
    ]
<//B_signatures>

Author Mark Published : Updated : 26/10/12

Translations : عربي, català, English, Español, français, Nederlands, русский, Türkçe, українська