last modified: Nov 30, 2006
(first posted: Aug 27, 2006)
(1275 Reads)
keywords: block layout
Permalink
(first posted: Aug 27, 2006)
(1275 Reads)
keywords: block layout
Permalink
Block Layout Anomolies
An on-going random list of tips, tricks, and gotcha in Xaraya's block layout (BL) templating system.
<xar:set>
- variables should not contain hyphens, probably gets confused with a minu sign in the php.
- content between the <xar:set> and </xar:set> is plain ol' php
- to set an array <xar:set name="arr">array( 'key1'=>$value1, 'key2'=>$value2 )
- to modify an existing array <xar:set name="asdf">1; arr['key1']=$value3;</xar:set>
Array key
- if BL rejects an array reference, remove the single quotes around the key value, such as <xar:image-resize src="$img_file[fileId]"
Embedding php
These are hacks for embedding php in the template. Note, this is not advised or 'supported', and I do it probably alot more often than I should. But sometimes practical implementation now trumps style and future maintenance (I'll pay dearly for this later, I know). Either of the following will work:
- <xar:set name="asdf">1; [normal php code here]</xar:set>
- <xar:if condition="[normal php code here]"></xar:if>
There are no comments attached to this item.



