Re: Using Freemarker to generate Freemarker?

"Newman, John W" <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Message-ID <D688C4D318A63D4290AA94A33E06F7D2029C519395@msxmbxnsprd14.acct.upmchs.net>
You could also use the [#noparse] directive, but good luck.

[#assign x = [ 1, 2, 3, 4, 5 ] /]
[#list x as i]
	[#noparse]
	[#if [/#noparse]${i}[#noparse] > 1]
		[@print [/#noparse]${i}[#noparse] /]
	[/#if][/#noparse]
[/#list]

Eek.. but it could work if you are patient enough


-----Original Message-----
From: Daniel Dekany [mailto:[email protected]] 
Sent: Saturday, May 15, 2010 10:37 AM
To: gz1
Cc: [email protected]
Subject: Re: [FreeMarker-user] Using Freemarker to generate Freemarker?

Use square-bracket syntax for the first pass:
http://freemarker.org/docs/dgui_misc_alternativesyntax.html

Then it's obvious which tags has to be resolved in the 1st, and which in the 2nd pass. Otherwise it's quite messy to find it out, even if FM would ignore calling undefined directives.


Friday, May 14, 2010, 11:07:06 PM, gz1 wrote:

>
> Hello,
>
> What's the best way to use Freemarker to generate Freemarker?  Ideally 
> I'd like to processes a template and substitute the tags that it finds 
> bindings for.  If no binding is found for a tag/expression I'd want it 
> to just render the tag as-is.  Right now Freemarker tosses its 
> exception cookies if an expression is undefined because there is no binding for it.
>
> I'm wanting to pre-process a Freemarker template and substitute some 
> tags, but not all.  After this initial pre-processing the resultant 
> output (also a Freemarker template) is processed again by another 
> object to replace the remaining expression tags.
>
> Any ideas?  Thanks!
> Greg

--
Best regards,
 Daniel Dekany


------------------------------------------------------------------------------

_______________________________________________
FreeMarker-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freemarker-user


------------------------------------------------------------------------------
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.