You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@groovy.apache.org by Raviteja Lokineni <ra...@gmail.com> on 2016/09/29 14:34:12 UTC

How to write groovy conditionals inside a groovy template

Hi,

I am using Groovy templating engine inside a Spring Boot application which
uses MarkupTemplateEngine
<http://docs.groovy-lang.org/latest/html/documentation/template-engines.html#_the_markuptemplateengine>
.

I would like to know how to use a if/else block inside a template which
will be consumed by MarkupTemplateEngine
<http://docs.groovy-lang.org/latest/html/documentation/template-engines.html#_the_markuptemplateengine>

Thanks,
-- 
*Raviteja Lokineni* | Business Intelligence Developer
TD Ameritrade

E: raviteja.lokineni@gmail.com

[image: View Raviteja Lokineni's profile on LinkedIn]
<http://in.linkedin.com/in/ravitejalokineni>

Re: How to write groovy conditionals inside a groovy template

Posted by Raviteja Lokineni <ra...@gmail.com>.
Sorry, my bad. It was a different error which led me to think it doesn't
work.

On Thu, Sep 29, 2016 at 10:35 AM, Guillaume Laforge <gl...@gmail.com>
wrote:

> Hi Raviteja,
>
> You can use plain if statements in those templates.
>
> Guillaume
>
> On Thu, Sep 29, 2016 at 4:34 PM, Raviteja Lokineni <
> raviteja.lokineni@gmail.com> wrote:
>
>> Hi,
>>
>> I am using Groovy templating engine inside a Spring Boot application
>> which uses MarkupTemplateEngine
>> <http://docs.groovy-lang.org/latest/html/documentation/template-engines.html#_the_markuptemplateengine>
>> .
>>
>> I would like to know how to use a if/else block inside a template which
>> will be consumed by MarkupTemplateEngine
>> <http://docs.groovy-lang.org/latest/html/documentation/template-engines.html#_the_markuptemplateengine>
>>
>> Thanks,
>> --
>> *Raviteja Lokineni* | Business Intelligence Developer
>> TD Ameritrade
>>
>> E: raviteja.lokineni@gmail.com
>>
>> [image: View Raviteja Lokineni's profile on LinkedIn]
>> <http://in.linkedin.com/in/ravitejalokineni>
>>
>>
>
>
> --
> Guillaume Laforge
> Apache Groovy committer & PMC Vice-President
> Developer Advocate @ Google Cloud Platform
>
> Blog: http://glaforge.appspot.com/
> Social: @glaforge <http://twitter.com/glaforge> / Google+
> <https://plus.google.com/u/0/114130972232398734985/posts>
>



-- 
*Raviteja Lokineni* | Business Intelligence Developer
TD Ameritrade

E: raviteja.lokineni@gmail.com

[image: View Raviteja Lokineni's profile on LinkedIn]
<http://in.linkedin.com/in/ravitejalokineni>

Re: How to write groovy conditionals inside a groovy template

Posted by Guillaume Laforge <gl...@gmail.com>.
Hi Raviteja,

You can use plain if statements in those templates.

Guillaume

On Thu, Sep 29, 2016 at 4:34 PM, Raviteja Lokineni <
raviteja.lokineni@gmail.com> wrote:

> Hi,
>
> I am using Groovy templating engine inside a Spring Boot application which
> uses MarkupTemplateEngine
> <http://docs.groovy-lang.org/latest/html/documentation/template-engines.html#_the_markuptemplateengine>
> .
>
> I would like to know how to use a if/else block inside a template which
> will be consumed by MarkupTemplateEngine
> <http://docs.groovy-lang.org/latest/html/documentation/template-engines.html#_the_markuptemplateengine>
>
> Thanks,
> --
> *Raviteja Lokineni* | Business Intelligence Developer
> TD Ameritrade
>
> E: raviteja.lokineni@gmail.com
>
> [image: View Raviteja Lokineni's profile on LinkedIn]
> <http://in.linkedin.com/in/ravitejalokineni>
>
>


-- 
Guillaume Laforge
Apache Groovy committer & PMC Vice-President
Developer Advocate @ Google Cloud Platform

Blog: http://glaforge.appspot.com/
Social: @glaforge <http://twitter.com/glaforge> / Google+
<https://plus.google.com/u/0/114130972232398734985/posts>