> > 1) My main header ( 100 px in height ) with the login in the header ( > similar to facebook ) when visiting the main index page > 2) The same main header ( with 100 px in height ) but without the login in > the header -- ( this one I got it right .. it works just fine ) > > 3) another header ( when the user is logged in, This one is a header of > 50px in height an additional custom menu for the logged in user ) > > I am having problems with header (1) and (3) > > My problem with (1) has to do with the login that I cannot customize its > presentation layout in my header of 100 px in height ! >
auth.login() will generate (and process) a login form. You can customize the way it is displayed the same way you can customize any SQLFORM -- see http://web2py.com/books/default/chapter/29/7#Custom-forms. > If I had to translate what I need to do, it goes like this : > ------- > If the user is logged in ( meaning the user exists in the db and logged > in successfully with its email and password ) > then ( show header(3) ) > if not > then ( show header(1) ) or ( if the current page is not the main index > page then (show header(2) ) > In layout.html: {{if auth.user:}} [code for header(3)] {{else:}} {{block header}} [code for header(2)] {{end}} {{pass}} In index.html: {{block header}} [code for header(1)] {{end}} When the "index" view is rendered, the "header" block in the index.html view will replace the "header" block in the layout.html view (but in either case, the "header" block will only be rendered when the user is not logged in -- otherwise, the code for header(3) will be rendered). > How do I manipulate or successfully work with the following calls in > web2py : > - request.args* > Not sure what you need to do with request.args. > - auth.settings.* > You can set auth.settings anywhere -- typically in a model file, wherever you define the rest of Auth. > - is_logged_in > To check for login, you can use auth.is_logged_in() or just check auth.user (as above). Anthony