Control structures

Control structures include loops and tests, and they are normally inserted using hyperlinks with the py3o:// protocol.

In the current version of the py3o. template, two control structures exist: py3o://for="varname in iterable" and py3o://if="condition". Both need to be closed with py3o:///for and py3o:///if, respectively. Note that there is no else in a condition; you need to make a second py3o:// if blocked with the opposite condition.

Caution: There are two forward slashes in the opening hyperlink URL and three in the closing hyperlink URL.

With the constraint of using a hyperlink in mind, the result is very similar in spirit to the templating of emails explained in the Email Templates recipe earlier in the chapter.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.58.113.193