<body class="{{=get_page_class()}}">
El ene 2, 2014 1:11 p.m., "Ruud Schroen" <r...@formatics.nl> escribió:

> Hi,
>
> I want to add a class to the body depending on the controller and function
> (like Drupal does for example).
>
> My function (in db.py):
> def get_page_class():
>     page_class = 'page-%s-%s' % (request.controller, request.function)
>     return page_class
>
> And in my view:
> <body class="{{=get_page_class}}">
>
> Now when i load the page, this is the output
> <body class="&lt;function get_page_class at 0xb5af3ae4&gt;">
>
> ..and the function isn't even called.
>
> What am i doing wrong?
>
>
>  --
> 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 web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to