I tried to create a page registrer.html in default/user/ with this following function in my controler but the redirection doesn't work.
def register():
form = auth.register(next=auth.settings.register_next)
return dict(form = form)
Where is it possible to change the settings of this drop down menu?
The next
parameter indicates where to redirect the user after a successful registration. If you want to provide your own controller and view for the register form, then you could use:
def user():
if request.args(0) == "register":
# Use my own view.
response.view = "views/default/your-custom-tempalte.html"
form = auth.register(...)
return dict(form=form)
else:
# Provide the default view for the remaining actions (log in, log out, etc.)
return dict(form=auth())
Although web2py's philosophy is "convention over configuration" and "everything should have a default", that doesn't mean you must use the defaults. Usually even the defaults in web2py are very customizable. However the auth.navbar()
function, which builds the "user" navigation bar, is not highly customizable.
In short: if the defaults are not good enough, just write your own navigation bar.