On Saturday, April 23, 2011 3:47:17 PM UTC-4, Anthony wrote:
>
> Second, I would like to get read of the "Welcome <first name>" message
>> next to the logout buttons.
>> I tried looking into the auth code and couldn't see where this was
>> easily possible. For example I don't understand how to make my own auth
>> form and response on any other page by the default one.
>
>
> The login and logout links are generated by the 'navbar' method of the Auth
> class in /gluon/tools.py. auth.navbar() returns a web2py HTML helper object,
> so you can use the server-side DOM to alter it before it is rendered (see
> http://web2py.com/book/default/chapter/05#Server-side-DOM-and-Parsing).
>
Specifically, "Welcome" and the first name are the first two components of
the SPAN object returned by navbar(), so you could do:
In a controller or view:
nav = auth.navbar()
nav.components = nav.components[2:] # drop the first two components of the
SPAN object
In the view:
{{=nav}}
Anthony