Solved in two different ways.

1.  Must have done something dumb, but it works to put a custom auth.bar in 
a model, menu.py is a good one.  This worked:
def user_bar():
    if auth.is_logged_in():
        logout = A('Logout', _href = URL('full', 'user', args='logout'))
        profile = A('Profile', _href = URL('full', 'user', args='profile'))
        password = A('Change Password', _href = URL('full', 'user', 
args='change_password'))
        bar = SPAN('Welcome, ' + auth.user.first_name, ' | ', profile, ' | 
', password, ' | ', logout, _class = 'auth_navbar')
    else:
        login = A('Login', _href = URL('full', 'user', args='login'))
        register = A('Register', _href = URL('full', 'user', 
args='register'))
        lost_password = A('Lost Password', _href = URL('full', 'user', 
args='request_reset_password'))
        bar = SPAN(' ', login, ' | ', register, ' | ', lost_password, 
_class = 'auth_navbar')
    return bar

I referred to it in a view via:  {{=user_bar()}}.  Not clear what I did 
wrong before, it works.

2.  Then, I read the manual ("rfm") about gluon.tools/auth and discovered I 
could explicitly provide an action as a named argument:   <div 
id="navbar">{{='auth' in globals() and 
auth.navbar(action='user',separators=(' ',' | ',''))}}</div>.  This also 
worked.

Sometimes, you need to look at source to figure out how an argument will be 
parsed to provide the right argument.  For example, including the 
controller as in full/user did not work as web2py assumes the current 
controller when not supplied. 

Thanks.

So, I have 2 ways to do as I want.  I have used method 2.

-- 



Reply via email to