annet
unread,Oct 5, 2010, 2:04:30 AM10/5/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to web2py-users
In my custom _ajax.html file I insert css and js files that are not
needed by every view in the application, therefore I wonder whether it
is possible to use conditionals in response.files.insert(), in that
case .css and .js files are only included when they are really
needed.
This is what I have in mind:
{{
response.files.insert(0,URL(r=request,a='base',c='static',f='base/css/
reset.css'))
...
if request.function=='cardexamples':
response.files.insert(3,URL(r=request,a='base',c='static',f='base/
css/jquery.lightbox-0.5.css'))
response.files.insert(9,URL(r=request,a='base',c='static',f='base/js/
jquery.lightbox-0.5.js'))
pass
...
if request.controller=='card' or request.controller=='view':
response.files.insert(10,URL(r=request,a='base',c='static',f='base/
tiny_mce/tiny_mce.js'))
pass
for _item in response.meta or []:}}
Kind regards,
Annet.