You can, but will not work if you compile your app.
This can be done with.
in models/anything.py
response.layout_path = "layout_XXX.html" if session.call else 'layout.html'
# this can also be changed in controller if needed
def action():
if something:
response.layout_path = "otherfile.html"
So in view
{{extend response.layout_path}}
On Sat, Dec 29, 2012 at 3:15 AM, Simon Ashley <[email protected]> wrote:
> Wondering if it is possible to have a conditional {{extend layout.html}}
> similar to the following?
>
> {{if session.call:}}
> {{extend 'layout_XXX.html'}}
> {{pass}}
>
> {{if not session.call:}}
> {{extend 'layout.html'}}
> {{include 'YYY.html'}}
> {{pass}}
>
> ....
>
> Required for users with requiring different configurations.
> Have tried alternative approaches without success.
> TIA
>
> --
>
>
>
>
--