[web2py] Re: response.files.append are broken

2010-02-23 Thread sherdim
oh, yes
I have looked at the code in the web2py_ajax.htm - ingenious and
simple !

Though it is a narrow topic of using of web2py_ajax, which is
optional, it concerns an important issue of the following to the web
standards.

The W3C validator swears hard on styles inside body. But the template
system of web2py does not suppose the overt way to append style
modules in the final html-templates.

So it concerns an important design issue. The  response.files handler
is a real way to meet the standards.

I do not know about the need to compulsory transfer of all style-
snippets to the HEAD - I think any webmaster  should decide himself.
But the documentation or the book should state overtly:

To append the given JSCSS lib in the given terminal template, from
which  all HTML will get inside BODY tag of the parent template, use
the collection response.files. Links to the lib modules could be
appended to the end of the standard link collection of web2py_ajax.htm
template, which is parsed inside HEAD tag. As a result you will have a
flexible template hierarchy to generate web pages in the concordance
with the W3C standards. IMPORTANT!!! Insert in the response.files
before the extend instruction of the template:

e.g.
{{
response.files.append(URL(r=request,c='static',f='highslide/
highslide.js'))
response.files.append(URL(r=request,c='static',f='highslide/
highslide.css'))
}}
{{extend 'layout.html'}}
OTHER HTML code ...


++: you need not to organize extra procedure calls from the HEAD of
the parent template (layout.html) to check whether a child template
declares such procedure.

--: you must use  web2py_ajax.htm (or its analog)

Vale!

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: response.files.append are broken

2010-02-21 Thread mdipierro
yes. views are executed sequentially therefore
response.files.append(...) has not affect after {{import
'web2py_ajax.html'}} where the actually import is actually done. You
can do

{{reponse.files.append()}}{{extend 'layout.html'}}
bla bla bla

since the layout will import web2py_ajax.html after the
response.files.append(...)



On Feb 21, 2:20 pm, sherdim sher...@gmail.com wrote:
 Instructions response.files.append for new js and css imports don't
 work in the view file when inserted in the body.

 Is it by design? and they are allowed in the head of layout.html only?

 Vale!

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.