#EDITABLE

#EDITABLE is an environment variable for forms, which indicates if such forms are editable or not.
  • New in : SPIP 2.0

Used within a template file that includes a CVT form, the #EDITABLE tag indicates if the site visitor needs to enter the data for a form.

By testing the value of the tag, the template can opt to hide the data entry part of the form, since it is called after validating the value of our tag.

Using the example from CVT Forms by example:

[<p class='formulaire_ok'>(#ENV*{message_ok})</p>]
[<p class='formulaire_erreur'>(#ENV*{message_erreur})</p>]
[(#EDITABLE|oui)
	<form action='#ENV{action}' method='post'>
		#ACTION_FORMULAIRE{#ENV{action}}
		<label>Your email</label>
		[<span class='erreur'>(#ENV**{erreurs}|table_valeur{email})</span>]
		<input type='text' name='email' value='#ENV{email}' />
		<br />
		<label>Your message</label>
		[<span class='erreur'>(#ENV**{erreurs}|table_valeur{message})</span>]
		<textarea name='message'>#ENV{message}</textarea>
		<input type='submit' name='ok' value='ok' />
	</form>
]
  • If we have just accepted the user’s data, then we inform the site visitor as such.
  • If there is an error, we display it.
  • If we are in data entry mode, we display the HTML form.

Author Mark Published : Updated : 08/07/23

Translations : català, English, français, Nederlands, slovenčina