A WM brain bender
Marc Palmer <[email protected]>
| Newsgroups | gmane.comp.java.webmacro.user |
|---|---|
| Organization | AnyWare Ltd. |
| Message-ID | <[email protected]> |
Hi,
Long time no speak!
I finally got around to getting 2.0b1 (only a year late!) and am working
on the start of CMS using WM.
I wonder if I'm being really stupid, but I want some of the content,
which is pulled in from String data, to be treated as a WM template.
So given a content string loaded from the CMS, say "<p>Hello,
$name</p>", I want to use this in my page, a template itself, but have
$name evaluate. i.e. something like this in the main CMS rendering template:
<div>
#eval $content.Data using { "contextData": $someData }
</div>
...but eval only works with Macro objects to my knowledge.
Does anybody know how I can do this? I effectively want the same as
#include but from a String instead of a file.
I've tried:
<div>
#templet $block
$content.Data
#end
#eval $block using { "contextData": $someData }
</div>
...but of course this is not correct as $content.Data is not evaluated
at the time the templet is defined. I also tried #setblock as macro etc.
It's a bit confusing. I'd like to not have to write a helper/directive
to load a Macro tempalte from a String unless I have to...
Thanks in advance.
--
Marc Palmer - - - [email protected]
Wangjammers, J2ME Developers
~ http://www.wangjammers.org/games/
Blog
~ http://www.jroller.com/page/Wangjammer5
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click