Most web development agencies have a testing or staging environment for their clients, to show them new stuff before it gets into production. A common problem we encounter is that clients often forget what the difference between the environments is. This results in data entries at the staging environment, which are not visible on the production site. Or even worse, clients point their audience to the staging site instead of the production site. To inform any visitor about the staging environment, we today created a ZF2 module for this: Soflomo’s StagingBar.
The module is called Soflomo\StagingBar and it renders a black bar at the top of every page. If you do not configure anything, this is the default look (it looks a bit small, mind the bar fills the full width of the viewport):
The text is automatically translated (Dutch, French and Spanish translations available). Though it is a very small module, it has a few neat tricks:
- Automated injection just after the
- Overridable view script, so you can design your own
- Inline styles, so you don’t need to include a separate css file
- Injectable variables from a configuration file, so you can direct visitors to the url of your production site
Check the code out at Github or get version 1.* via composer (named