Can we conditonalize a page using greater or less than syntax so that if the num-teams is less than 200 do "this", if not, do "this"?

Options

T/F logic at first seems quite limiting, but if you think outside the box a bit and consider order of operations you can actually do quite a bit with it. A quick overview of a Convio conditional is:



] --> "if A contains B do C, else do D"



Two of our most useful advanced techniques involve expanding A:

* A as nested conditionals

* A is a set of options



Using A as nested conditionals is part of the solution here, in coordination with and overall nesting of conditionals in the rendering stage. Think in terms of using A as nested conditionals think in terms of strung together statements, each of which will render T or F... The "Contain" (B) part of the equation is then simply your desired outcome among: TT, TF, FT, FF. So your basic element to evaluate is:

] >]]::1::T::F]]] >]]::1::T::F]]



The full conditional in long form is:

] >]]::1::T::F]]] >]]::1::T::F]]

::TT::

do W

::

] >]]::1::T::F]]] >]]::1::T::F]]

::FT::

do X

::

] >]]::1::T::F]]] >]]::1::T::F]]

::TF::

do Y

::

do Z (since there are only four possibilities, this else cas can only be FF)

]]

]]

]]



That is a pretty long one with lots of room for error, be sure that the number of ] and do it on a test page before deploy it live. If you have many admins doing work on pages where you want to use the conditional, try putting the code into a resuable and calling it where you need. That way no one has to worry about the conditional once it is set.



Sincerely,

Glen





******************************************

Bonus: A as set of options

By using delimiters, A can be a list of options since the condition is based on "contains" rather than "equals". The most frequent delimiter is "x", however you could use just about any character or string of characters ("xyx" is a popular extended delimiter). The way it works is:

]

--> this reads "if x123x456x789x contains x123x render T, otherwise F"

>> in this case it renders T



More commonly some value would be represented by an S-Tag, such as:

]x::T::F]]

--> "if x1090x1100x contains the fr_id in the url surrounded by x render T, else F"

>> would render T when visiting most of the pages in your two TeamRaisers

************************************

Tagged:

Categories