Adding login boxes to main page header

Adding login boxes to main page header

by Alan Paton -
Number of replies: 5
I am creating a new theme for my organisations Moodle and I'd like if I could add the login to the header on the home page. I've tried amending the header.html file with info from index_form.html, and while I can get the form boxes to show, I can't get them to work. Any tips on where to look and what to do are welcome
In case it's not clear, what I want is rather like what is on this page http://www.nilesschools.org/vikingnet/
where the home page displays the username, password boxes, and new account and forgot password links within the header of the page.

Average of ratings: -
In reply to Alan Paton

Re: Adding login boxes to main page header

by Sam Wynens -
Be sure that your form is submitting to /login/index.php. If anything is accessed outside of the login folder, just make sure you reference that directory.

Sam
In reply to Sam Wynens

Re: Adding login boxes to main page header

by Alan Paton -
Thanks Sam, that works. I should have spotted that, and feel suitably dumb now.
In reply to Alan Paton

Re: Adding login boxes to main page header

by Patrick Malley -
Alan -

Here is the specific CSS code that I used to set the location of the login block at http://www.nilesschools.org/vikingnet/:


.block_login {
color:#fff;
position:absolute;
width:175px !important;
margin-left:8px;
top:80px;
}


I made no alterations to my header.html file. Of course, your installation will be unique, but this should give you an idea of where to start.

If you continue to have problems, let me know. My theme took about a month of obsessing over and positioning that login block took quite some effort - therefore, there might be more code involved in rendering this correctly than I remember. Nevertheless, it's a start!

Good luck.
In reply to Patrick Malley

Re: Adding login boxes to main page header

by Alan Paton -
Thanks Patrick, I hadn't thought of doing it that way. Tried it out and it sort of gets what I want, with some css tweaking. Will be doing more experimenting, but seem to be getting somewhere now.

I'd still be interested if anyone could tell me how to add functions detecting when user is logged in etc.
In reply to Alan Paton

Re: Adding login boxes to main page header

by Sam Wynens -
Are you talking about that little "You are logged in as XXXX (Logout)" that you see at the bottom of the pages?

If so, just look at footer.html. I think it's the only thing there.

Sam