soo_image user guide Page 14 of 16 « »
Conditional tags
Standard conditional tag behavior, compatible with else
. Can be used anywhere. They require image context or else they will always evaluate to false
(or empty in the case of soo_if_image_count
, which treats context somewhat differently).
soo_if_txp_image
<txp:soo_if_txp_image>...<txp:else />...</txp:soo_if_txp_image>
Attributes
soo_if_txp_image
does not accept any attributes; it simply checks whether or not the image is stored in the Txp image table (as opposed to an article image declared by URL).
soo_if_image_* (-author, -category, -thumbnail)
<txp:soo_if_image_author>...<txp:else />...</txp:soo_if_image_author> <txp:soo_if_image_category>...<txp:else />...</txp:soo_if_image_category> <txp:soo_if_image_thumbnail>...<txp:else />...</txp:soo_if_image_thumbnail>
Attributes
soo_if_image_thumbnail
does not accept any attributes; it simply checks whether or not the image has a thumbnail.
soo_if_image_author
and soo_if_image_category
each accept the following attribute:
name
(text)
Comma-separated list of values. Condition is true if the value from the image is in this list. Important: forsoo_if_image_author
, use author login names, not full names. If unset (the default), condition is true if the value from the image is empty or 0.
soo_if_image_count
<txp:soo_if_image_count>...<txp:else />...</txp:soo_if_image_count>
Counts the images available and allows conditional checks against that number. It checks the following contexts, in order of priority:
- Inside a
soo_image_select
tag or form - Inside an
article
orarticle_custom
tag or form (checks article images) - In an image category page (Txp 4.3.0 or later).
Outside any of these contexts, the tag does not return any output.
Attributes
exact
(integer) Exact number of images to check formin
(integer) Minimum number of images to check formax
(integer) Maximum number of images to check for
All attributes default to empty; you must set one or the tag returns no output.