Spice Command Set Example

Demonstrates the use of the spice.command.set viper. For this example the following querystring value is assumed: hid=img;w=200;h=200;r=20;tint=red

Smartsite SXML CopyCode image Copy Code
<se:format inputdata="{spice.command.getall()}" whitespace="simpleformat">
    <se:rowformat>
        <se:colformat> <td>{this.field()}</td>{char.crlf()}</se:colformat>
        <se:rowresult><tr>{char.crlf()}{this.rowresult()}</tr>{char.crlf()}</se:rowresult>
    </se:rowformat>
    <se:resultformat>
        <table>{char.crlf()}{this.result()}</table>
    </se:resultformat>
</se:format>
{spice.command.set('img.resize.width', 400)}
{spice.command.set(img, tint, blue)}

<se:format inputdata="{spice.command.getall()}" whitespace="simpleformat">
    <se:rowformat>
        <se:colformat> <td>{this.field()}</td>{char.crlf()}</se:colformat>
        <se:rowresult><tr>{char.crlf()}{this.rowresult()}</tr>{char.crlf()}</se:rowresult>
    </se:rowformat>
    <se:resultformat>
        <table>{char.crlf()}{this.result()}</table>
    </se:resultformat>
</se:format>
Example Result CopyCode image Copy Code
<table>
<tr>
 <td>img</td>
 <td>resize</td>
 <td>width</td>
 <td>200</td>
</tr>
<tr>
 <td>img</td>
 <td>resize</td>
 <td>height</td>
 <td>200</td>
</tr>
<tr>
 <td>img</td>
 <td>rotate</td>
 <td>degrees</td>
 <td>20</td>
</tr>
<tr>
 <td>img</td>
 <td>duotone</td>
 <td>tint</td>
 <td>red</td>
</tr>
</table>





<table>
<tr>
 <td>img</td>
 <td>resize</td>
 <td>width</td>
 <td>400</td>
</tr>
<tr>
 <td>img</td>
 <td>resize</td>
 <td>height</td>
 <td>200</td>
</tr>
<tr>
 <td>img</td>
 <td>rotate</td>
 <td>degrees</td>
 <td>20</td>
</tr>
<tr>
 <td>img</td>
 <td>duotone</td>
 <td>tint</td>
 <td>blue</td>
</tr>
</table>