This is a rather very tech solution as it requires some experience in configuring Apache. The advantage is that you don't have to hack any files in the Joomla! installation itself.
Basically what I want to do is to append some HTML to any page (almost any page) being generated.
For this I will use Apache Module mod_substitute. The module itself needs to be activated (it generally just needs the # comment removed) inside httpd.conf
.
LoadModule substitute_module modules/mod_substitute.so
Next in the virtual hosts file (httpd-vhosts.conf
):
<VirtualHost *>
DocumentRoot "C:\...."
ServerName joomla-development
AddOutputFilterByType SUBSTITUTE text/html
Substitute "s|</body>|<div style='position:fixed; left:100px; top:50px; background-color:red'><h1>DEV WEBSITE</h1></div></body>|i"
<Directory "C:\....">
AllowOverride All
Require all granted
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Basically with Substitute
I am replacing the </body>
tag with some HTML. This way I try to stay out of any Ajax request.
Final result:
