you can do
in layout.html:
<html>
{{try:}}{{header()}}{{except:}}default header{{pass}}
...
{{include}}
</html>
in index.html
{{def header():}}custom header{{return}}
{{extend 'layout.html'}}
body to be included
On Feb 3, 7:34 pm, Baron <[email protected]> wrote:
> hello,
>
> I have a number of views that extend a base layout but I want to
> customize the included Javascript libraries in each view.
> With Django I would create a header block in the base layout {% block
> header %}{% endblock %}
> and then extend it when necessary in each view.
>
> So far with web2py I've been putting the logic of which libraries to
> include in the base layout, which depends on flags defined in the
> controller functions. With many views this is getting messy.
> Is there a better way to customize the included Javascript libraries
> for a view, but still extend a common base layout?
>
> Baron
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---