One thing that has irritated me for years is how developers handle their backoffice demos. It seems like with everyone you have to copy the username and then copy the password before you can login. For years I thought there had to be a better way. When I setup our demos for thirty bees I took that to task. I created a simple little modification that will allow you to automatically log users into the backoffice of your demo sites. This creates a better user experience and reduces the bounces of people that might not feel like going to the trouble.

What I ended up doing was pretty simple to be honest and it works perfectly, without any major changes. What I did was add the small javascript snippet below to theĀ ADMIN-DIRECTORY/themes/default/template/controllers/login/content.tpl

Then I went to the form fields in the same file and I found the user name input and the password input. There I added value attribute to both tags with one being the email address and the other being the password. So now when the back office login page loads, the form is pre-populated. When the page is fully ready, the javascript above submits the form and the user is logged in without having to ever copy a user name or a password. This can even work if you send users to specific pages in the back office as well, they will be automatically logged in and directed to the specific page that you linked to. This makes demoing your modules easy peasy.