24.10.2013 Views

FotoWeb 6.0 User Guide - Customization - FotoWare

FotoWeb 6.0 User Guide - Customization - FotoWare

FotoWeb 6.0 User Guide - Customization - FotoWare

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Customizing <strong>FotoWeb</strong> 3.0<br />

2.6 Script rules<br />

Now that you have been introduces to basic elements of <strong>FotoWeb</strong> scripting, its time to get to know the rules. The<br />

rules are few and simple and, more or less, already explained during the introduction of the elements.<br />

Failure to follow these rules can cause incorrect information display, compromise security and processing stops.<br />

<strong>FotoWeb</strong> has implemented several mechanisms to prevent these occurrences, but the best mechanism lies in the<br />

hands of the template programmer – adoption of <strong>FotoWeb</strong> script rules.<br />

2.6.1 Close/End the tags<br />

Whether it is an empty or non-empty tag, it must be closed with a forward slash ‘/’. For example:<br />

<br />

Example 31: Closing empty tags.<br />

Empty tags are closed by themselves by adding the closing mark ‘/’ right before the closing identifier ‘%>’, with no<br />

space in between them.<br />

<br />

. . .<br />

<br />

Example 32: Closing non-empty tags.<br />

The non-empty tags that create a context, must be closed with a separate closing tag. The closing tag is the same as<br />

starting tag, but with a closing mark ‘/’ right before the tag name, with no space in between them.<br />

Failure to close a tag will invalidate the hierarchal structure of the template and case a parsing error during template<br />

validation.<br />

2.6.2 Close/End contexts<br />

This rule is based on the same principal as the previous, but extends a little further. As explained in the previous<br />

rule, tags creating a context (non-empty tags) must be closed with a closing tag. Similarly, the evaluation tags (‘if’<br />

and ‘ifnot’) must also close their contexts with ‘endif’.<br />

<br />

. . .<br />

<br />

. . .<br />

<br />

<br />

. . .<br />

<br />

. . .<br />

<br />

Example 33: Closing 'if' and 'ifnot' tags.<br />

Starting tag.<br />

Closing tag with closing mark ’/’.<br />

’/’ closes the tag.<br />

Starting evaluation tag.<br />

Closing evaluation tag.<br />

Starting evaluation tag.<br />

Closing evaluation tag.<br />

Optional else.<br />

Optional else.<br />

Failure to close a tags’ context will invalidate the hierarchal structure of the template and cause a parsing error<br />

during the template validation..<br />

16 / 47 <strong>FotoWare</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!