Note, you can do a conditional {{include 'somefile.html'}}, and I believe 
that will be able to compile (as long as the include doesn't include a 
variable). The compiled view will include all the code from both included 
views, though only one will be executed, depending on the condition.

Anthony

On Sunday, October 2, 2011 10:52:30 PM UTC-4, Anthony wrote:
>
> On Sunday, October 2, 2011 8:37:17 PM UTC-4, rochacbruno wrote:
>>
>>
>>
>> On Sun, Oct 2, 2011 at 9:29 PM, Anthony <aba...@gmail.com> wrote:
>>
>>> I don't think you can do a conditional {{extend}}, can you?
>>
>>
>> Yes it works, do not works only if you compile the app.
>>
>
> Are you sure? Doesn't seem to work when I try it?
>
> Instead, I think you can use a variable in an {{extend}} (which will not 
> work if the app is compiled). Something like:
>
> {{if "/appname/contname" in request.env.query_string:}} 
> {{layout = 'contname-layout.html'}} 
> {{else:}} 
> {{layout = 'layout.html'}} 
> {{pass}} 
>
> {{extend layout}} # cannot be compiled because value of layout not known at 
> compile time
>
> Anthony
>
>
>

Reply via email to