Controlling XML tags

To make template development process easier the plug-ins will have own tags processors. Tag of the plug-in is the general XML tag, submitting to the standard XML syntax.
At present there are 2 controlling tags used:

And also the set of tags, entered to ease the navigation processing while jumping to the next or previous page of the album.

Case

This tag is entered to process the situations, when album pages need to have different content (including text, images, comments) depending on the parameter value.
Syntax:

<CASE parameterName=”ParameterValue”>
Text ..................
<CASE/>

where parameterName is template parameter name, assigned in description file. (conforms to field Name of parameter description in description file). ParameterValue- possible value of parameter. (see Table 4 of Description file.)

Plug-ins process this tag the following way: When tag meets this name plug-in extracts parameterName and compares it with the list of template parameters. If that parameter is found then plug-in extracts its value, selected by the user, and compares it with ParameterValue field, which was received from template. In case when value, selected by the user and value from CASE coincide, then plug-in will extract the CASE shell from the result album page and will keep the contents of CASE unit. If the values will be equal then CASE unit will be fully removed from album pages.

Example:
<CASE GameType="Football">
                <script language="javascript">
                <!--
                                document.all.back.background = "{#Out(TextOut1(Load('images/Football.jpg'),'#TITLE#','Flyer ExtraBlackCondensed', 70, 0, 250,130,'0x00000000' ),'images/newback.jpg');}";
                                document.all.ll.src = "images/1x.jpg";
                                document.all.rr.src = "images/1x.jpg";
                                document.all.tbl.bgColor = "#283C9F";
                -->
                                    </script>
</CASE>
<CASE GameType="Hockey">
                <script language="javascript">
                <!--
                                document.all.back.background = "{#Out(TextOut1(Load('images/Hockey.jpg'),'#TITLE#','Flyer ExtraBlackCondensed', 70, 0, 250,130,'0x00000000' ),'images/newback.jpg');}";
                                document.all.ll.src = "images/1x2.jpg";
                                document.all.rr.src = "images/1x2.jpg";
                                document.all.tbl.bgColor = "#ff9933";
                -->           
                                    </script>
</CASE>

In that example we used GameType parameter, that has the following description in description file:

[Page2Param3]
Name=GameType
DisplayName=Game Type
Description=Game type skin
Type=AC_COMBOBOX
Tag="#GAMETYPE#"
NumValues=2
DefaultValue=Football
Value0=Hockey
		

From description you can see, that user will see Combo Box with 2 possible options:
Football è Hockey. (By default Football is installed).
Depending on the choice of the user, plug-in will keep
<script language="javascript">
                <!--
document.all.back.background = "{#Out(TextOut1(Load('images/Hockey.jpg'),'#TITLE#','Flyer ExtraBlackCondensed', 70, 0, 250,130,'0x00000000' ),'images/newback.jpg');}";
                                document.all.ll.src = "images/1x2.jpg";
                                document.all.rr.src = "images/1x2.jpg";
                                document.all.tbl.bgColor = "#ff9933";
                -->           
                </script>

(in case of "Hockey")
or

<script language="javascript">
                <!--
document.all.back.background = "{#Out(TextOut1(Load('images/Football.jpg'),'#TITLE#','Flyer ExtraBlackCondensed', 70, 0, 250,130,'0x00000000' ),'images/newback.jpg');}";
                                document.all.ll.src = "images/1x2.jpg";
                                document.all.rr.src = "images/1x2.jpg";
                                document.all.tbl.bgColor = "#ff9933";
                -->           
                </script>

(in case of "Football")

After being processed by controlling tag the result will be passed for further processing by plug-in. In the given example the template parameter #TITLE# will be substituted by real value, entered by the user, and after that the graphic processor will write the caption on image 'images/Hockey.jpg', and will derive it to 'images/newback.jpg'. So the real album page will have following contents

<script language="javascript">

                <!--

document.all.back.background = "images/newback.jpg";

                                document.all.ll.src = "images/1x2.jpg";

                                document.all.rr.src = "images/1x2.jpg";

                                document.all.tbl.bgColor = "#ff9933";

                -->           

                </script>

In this connection there will be caption on the image "images/newback.jpg" written with ExtraBlackCondensed font.


For

Tag For (loop) is used to copy the content of the tag. Content is copied as many times as many iterations will be executed. This is necessary, for example, when the number of rows or columns with images on the page is not known beforehand. The home loop is supported.
Syntax:
<for start="intValue" end=”intValue” diff="intValue" step="intValue" index="#string#">
……………………
</for>

Loop parameters:

parameters End and Diff are mutually exclusive i.e. it's better not to use them together. If this happens, then the End parameter will have the priority.

Example:

<for start=”0" diff="#THCOLS#" index="#imgindex#">

<td bgcolor="#000000" class="imgtitle" align="center"width="118">

#NAME#imgindex##

</td>

                 <td class="imgdesc" width="118">

#DESCRIPTION#imgindex##

</td>

</for>

In that example the template parameter value #THCOLS# will be replaced with real value, entered by the user and then content of the tag body will be copied inside the result page. At the same time value of the "#imgindex# argument will be replaced by index numeric value. So, after tag processing we'll get the following text:

Lets assume that user entered #THCOLS# (number of columns with images) equal to 2. In that case the subproduct will be the following:

<td bgcolor="#000000" class="imgtitle" align="center"width="118">

#NAME0#

</td>

                 <td class="imgdesc" width="118">

#DESCRIPTION0#

</td>

<td bgcolor="#000000" class="imgtitle" align="center"width="118">

#NAME1#

</td>

                 <td class="imgdesc" width="118">

#DESCRIPTION1#

</td>

 

After that plug-in will continue to process template pages and as a result the #NAME0#, #DESCRIPTION0# will be substituted with corresponding values (see Predefined parameters).

Home loops. In case of home loops, the inner loop fully runs during the every run of the outer loop.

Example of home loops:

<table>

<for start="0" diff="#THROWS#" step="#THCOLS#" index="#rowindex#">

<tr>

<for start="#rowindex#" diff="#THCOLS#" index="#imgindex#">

<td bgcolor="#000000" class="imgtitle" align="center"width="118">

#NAME#imgindex##

</td>

                 <td class="imgdesc" width="118">

#DESCRIPTION#imgindex##

</td>

</for>

</tr>

</for>

</table>

So the result before the first outer loop run, will be the following:
Let #THCOLS# = 2.
Then = #rowindex# = 0; We'll get

<table>

<for start="0" diff="#THROWS#" step="#THCOLS#" index="#rowindex#">

<tr>

<for start="#rowindex#" diff="#THCOLS#" index="#imgindex#">

<td bgcolor="#000000" class="imgtitle" align="center"width="118">

#NAME0#

</td>

                 <td class="imgdesc" width="118">

#DESCRIPTION0#

</td>

<td bgcolor="#000000" class="imgtitle" align="center"width="118">

#NAME1#

</td>

                 <td class="imgdesc" width="118">

#DESCRIPTION1#

</td>

</for>

</tr>

</for>

</table>

In the next run of the outer loop #rowindex#" = 0 + step = 2;
We'll get:

</table>

In the next run of the outer loop #rowindex#" = 0 + step = 2;
We'll get:

<table>

<for start="0" diff="#THROWS#" step="#THCOLS#" index="#rowindex#">

<tr>

<td bgcolor="#000000" class="imgtitle" align="center"width="118">

#NAME0#

</td>

                 <td class="imgdesc" width="118">

#DESCRIPTION0#

</td>

<td bgcolor="#000000" class="imgtitle" align="center"width="118">

#NAME1#

</td>

                 <td class="imgdesc" width="118">

#DESCRIPTION1#

</td>

</tr>

<tr>

<td bgcolor="#000000" class="imgtitle" align="center"width="118">

#NAME2#

</td>

                 <td class="imgdesc" width="118">

#DESCRIPTION2#

</td>

<td bgcolor="#000000" class="imgtitle" align="center"width="118">

#NAME3#

</td>

                 <td class="imgdesc" width="118">

#DESCRIPTION3#

</td>

</tr>

 

</for>

</table>

This way it is very easy to create tables with images using the home loops.

PREVIOUS, NOPREVIOUS, NEXT, NONEXT Tags

Tags are entered to ease the navigation between the album pages.
Tag processing is enough easy. Plug-in, depending on the index of the current page, number of images, not yet included into album and the number of images on the page, is computing if this page is the first, last or middle page of an album, which will have the previous and next pages. Considering this information, plug-in saves contents of the tags, for which this data about the next and previous pages is true.

Example:
The last page of an album is being processed (this page has previous page, but doesn't have next page). The following tags combination is found:

<previous>           

<a href="#base--#">

<img border="0" src="images/prev.gif" width="90" height="25"/>

</a>

</previous>

<noprevious>

<img src="images/x.gif" width="90" height="25"/>

</noprevious>

Plug-in knows that it has the previous page, so during processing of the previous tag it'll keep its content, and during processing of the noprevious tag it'll fully remove tag from the album page.
So the last page will have the following content:

<a href="#base--#">

<img border="0" src="images/prev.gif" width="90" height="25"/>

</a>

 

Tags NEXT and NONEXT are working similarly.