Could we add response.masthead?

60 vistas
Ir al primer mensaje no leído

Alan Etkin

no leída,
31 ene 2013, 12:04:30 p.m.31/1/13
para web2py-d...@googlegroups.com
I don't want to modify the default layout just for changing the header (masthead) for the scaffolding app. I wonder if it's convenient to add a response.masthead to menu.py and layout.html, so a user, for example me :), would be allowed to easily customize it. If this is not going to be useful for a general use case, then please ignore it.

In line 97 of layout.html
  {{=response.masthead or response.title or request.application}}

In line 7 of menu.py
  response.masthead = None

Massimo Di Pierro

no leída,
31 ene 2013, 2:01:32 p.m.31/1/13
para web2py-d...@googlegroups.com
Isn't that what title is for?

--
-- mail from:GoogleGroups "web2py-developers" mailing list
make speech: web2py-d...@googlegroups.com
unsubscribe: web2py-develop...@googlegroups.com
details : http://groups.google.com/group/web2py-developers
the project: http://code.google.com/p/web2py/
official : http://www.web2py.com/
---
You received this message because you are subscribed to the Google Groups "web2py-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py-develop...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Alan Etkin

no leída,
31 ene 2013, 2:55:04 p.m.31/1/13
para web2py-d...@googlegroups.com
Isn't that what title is for?

The trunk version of the layout.html file has

response.title or request.application

in two parts of the page:
once for the <title> tag, and after in the body of the page (masthead's h4 element)

As Paolo said, sometimes you want to differentiate the two elements. Suppose someone wants an img to be shown in masthead, if you set response.title to IMG(...), then the string output of the html element will be shown as page title. AFAIK there's no way of solving this unless you change the layout.html file (which is not that terrible, of course).

pbreit

no leída,
4 feb 2013, 4:23:38 p.m.4/2/13
para web2py-d...@googlegroups.com
If you want to differentiate, I say edit it yourself. The welcome app is just a set of sensible defaults which I think "response.title or request.application" is.
Responder a todos
Responder al autor
Reenviar
0 mensajes nuevos