Forums / Setup & design / Tip: Using Curly Braces in texttoimage
Alex Jones
Tuesday 27 April 2004 11:52:36 am
If you want to show the curly braces in an image generated via <i>texttoimage</i> make sure to not use the wash operator at the same time as it will cause all sorts of problems. For example this code will work:
{concat('{ ', $node_name, ' }')|texttoimage( 'nav_header' )}
This will not:
{concat('{ ', $node_name, ' }')|wash|texttoimage( 'nav_header' )}
nor will
{concat('{literal}{{/literal} ', $node_name, ' {literal}}{/literal}')|wash|texttoimage( 'nav_header' )}
Alex
Alex [ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ] <i>When in doubt, clear the cache.</i>
Tuesday 27 April 2004 12:27:30 pm
Actually, I wrote too soon. I ran into a few more problems, but I eventually solved the problem using a variable:
{set-block scope=global variable=specialhead}{literal}{{/literal} {$node_name|wash} {literal}}{/literal}{/set-block} <h1>{$specialhead|texttoimage( 'nav_header' )}</h1> {/let}
Bjørn Kaarstein
Tuesday 27 April 2004 1:16:05 pm
Hi Alex.
Is there any particular reason why you use the |texttomimage operator on your header?I've never used it myself, and new ideas are always welcome!
Regards Bjørn
Tuesday 27 April 2004 1:28:33 pm
Actually, the fact that it was within a header tag was a mistake. ;) I had begun to tinker with the header and just forgot to drop the the header tags when I shifted to using <i>texttoimage</i>. I've begun playing with <i>texttoimage</i> for some menus which I would like to use a specific font that is not installed on most machines. So, my use is purely design-oriented. Though at the moment the system is confusing me no end, so who knows if I'll end up using it. :(