in order to simplify the problem I created a simple layout.html with only
one include directive:
<div id="wrap">
<div class="container">
<div class="hero-unit">
<h1>template</h1>
</div>
<div class="row">
<div class="span4"><h3>span4</h3></div>
<div class="span8"><h3>span8</h3></div>
</div>
<div class="row">
<div class="span10"><h2>span10</h2></div>
{{include}}
{{pass}}
<div class="span2"><h2>span2</h2></div>
</div>
</div>
<div id="push"></div>
</div>
and an equal simple index.html:
{{extend 'layout.html'}}
{{if 'message' in globals():}}
<h3>{{=message}}</h3>
and the controller in default.py:
def index():
"""
example action using the internationalization operator T and flash
rendered by views/default/index.html or views/generic.html
if you need a simple wiki simple replace the two lines below with:
return auth.wiki()
"""
response.flash = T("Welcome to web2py!")
return dict(message=T('main'))
now this works with {{include}} but if I change to {{include
'default/index.html}} then I get the same recursive error. is there
something wrong with the path?
On Monday, December 10, 2012 12:21:45 PM UTC+1, jonas wrote:
>
> HI
>
> I have two views that I want to have in the same layout file. One is for
> the sidebar and the other one is for the main column.
>
> sidebar.html:
>
> {{extend 'layout.html'}}
>
> ....
>
> index.html:
>
> {{extend 'layout,html'}}
>
> ....
>
>
> and in layout.html:
>
> <section id="main" class="main row">
> {{if left_sidebar_enabled:}}
> <br>
> <br>
> <div class="span2 left-sidebar offset1">
> <!-- <div class="headerDivider"></div> -->
>
> {{include 'sidebar.html'}}
>
> </div>
> {{pass}}
>
> <div class="{{=middle_columns}}">
> {{block center}}
> {{include}}
> {{end}}
> </div>
>
> however, when I try to include the sidebar it gives recursive errors, and
> I cannot figure out why:
>
> Traceback (most recent call last):
> File "/Users/jonas/Dropbox/web2py/gluon/main.py", line 538, in wsgibase
> serve_controller(request, response, session)
> File "/Users/jonas/Dropbox/web2py/gluon/main.py", line 225, in
> serve_controller
> run_view_in(response._view_environment)
> File "/Users/jonas/Dropbox/web2py/gluon/compileapp.py", line 671, in
> run_view_in
> context=environment)
> File "/Users/jonas/Dropbox/web2py/gluon/template.py", line 781, in
> parse_template
> return str(TemplateParser(text, context=context, path=path,
> lexers=lexers, delimiters=delimiters))
> File "/Users/jonas/Dropbox/web2py/gluon/template.py", line 312, in __init__
> self.parse(text)
> File "/Users/jonas/Dropbox/web2py/gluon/template.py", line 752, in parse
> self.extend(extend)
> File "/Users/jonas/Dropbox/web2py/gluon/template.py", line 482, in extend
> _super_nodes=super_nodes)
> File "/Users/jonas/Dropbox/web2py/gluon/template.py", line 312, in __init__
> self.parse(text)
>
> .....
>
>
--