Developing for multiple roles with Drupal in one browser
Often when developing Drupal, you'll have multiple roles that you'll need to test. Generally, I'll be logged in on one browser as admin. I'll have another browser open for another role.
So I go in and make a change as admin, then visit the other browser to see how the change affects the other role. This gets time consuming and a bit tedious.
I happened to stumble across a solution that so far works very, very well. This solution really only works when developing locally, but I'm sure you could apply this to situations where you're developing online.
Developing Locally
I generally like to develop on the machine I work on. This makes it so much easier than developing online, where I have to deal with FTP and stuff. Developing locally is just so much smoother and faster, especially when developing themes.
So this solution depends on the idea that you're developing locally.
- Open a browser tab at
http://localhost. Login here as your admin user. This will be your admin tab. - Open another tab at
http://127.0.0.1. Now you'll notice that you won't be logged in as admin in this tab. Login here as the role you're developing for, and use this tab as your testing area for the role. - If you're on a local network, then you could use another tab for yet another role, or as just the anonymous user. For example, I could have another tab loaded at
http://192.168.1.2or whatever my local IP is. - If you need more tabs for more roles, you may want to look into modifying your
/etc/hostsfile. There you can setup a few more hostnames that could all resolve to your local machine. (I haven't tried this, but it'll probably work pretty well.)
There you go. No more additional open browser apps for development.

Post new comment