Are you saying you want logic in the layout that checks whether a given
block exists in the included view? I don't think you can do that. But
instead, you can set a global "right_sidebar_enabled" variable in the view
(that's exactly how that variable is intended to work).
In layout.html, there is:
{{right_sidebar_enabled = globals().get('right_sidebar_enabled',False)}}
...
{{if right_sidebar_enabled:}}
<div class="span3">
{{block right_sidebar}}
<h3>Right Sidebar</h3>
<p></p>
{{end}}
</div>
{{pass}}
So, by default, the sidebar is off. To enable it for a particular view, in
that view:
{{right_sidebar_enabled = True}}
{{extend 'layout.html'}}
Anthony
On Tuesday, June 17, 2014 11:47:38 AM UTC-4, lucas wrote:
>
> ok, yes, i agree, but how to test of the right_sidebar is empty or not
> under layout.html?
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.