Blog

Joomla 3.X: just a small Plugin to help you by Joomla Templates and Extensions development

Every Joomla Templates and Extensions developer has tricks to help himself to catch or analyze Variables, check how many Modules are on a given template position or catch User-Agent for any special behaviors you need. Normally I used to hard-code everything directly in the index.php of my Templates or later through an included files to have more cleanliness and order in the index. Last week I enjoy myself by writing a PlugIn that provides to attach at the end of <body> the same debugging lines.

How it works is very easy: it's a system PLG for Joomla and works through onAfterRender() Trigger Event of this CMS. The PlugIn gets and shows many useful Variables that we need to customize the output of CMS.

Of course, my PlugIn shows some Variables that I use for my projects (e.g.: Facebook Pixel Snippet, Modernizr, etc...), but if you don't need it, you can simply ignore them (You can also delete in the source code of PlugIn what you don't need, it is not an hard job!)

The PlugIn has few Parameters:
[1] A text field to set UserID of the Admin that have to see the Code-Lines, required (yes, it's only for one Admin... you!);
[2] A text field to set which Template position you need to monitor and count how many Module are active there;
[3] A color selector to set a more readable text on your template background color;

[4] In next release: an option to render the code lines in admin area too (very useful for Extensions development)

NOTE: you have to install the PlugIn, activate it and set your UserID in Params.
Then you MUST be logged in Front-End of your website or select Shared Session in CMS Global Configuration to see the Output.

Here below you can see a typical output of my PlugIn (depend to version):

=== CMS & Template Debugging =========
CMS Output Variables & Parameters
 Option = com_content
 View = featured
 Layout = undefined
 Page = undefined
 Task = undefined
 Menu ID = 101
 Element ID (Art) =
 Category ID = undefined
---------------------------
Language = it
Logged User ID = 70
---------------------------
Module Counter (pos: -set position-) = 0
---------------------------
Custom Params (for Digitest's templates)
 Modernizr = 0
 JQuery = 1
 Bootstrap = 1
 Mootools = 1
 Test Messages = 0
 Facebook Pixel = 1
---------------------------
USER Agent
 Device Type = Desktop/PC
 Platform = Windows
 Browser = Mozilla Firefox
 Version = 56.0
---------------------------
Common Extensions Status (Installed & Active)
 OpenGraph = No
 Page Title Extended = No
 K Secure = No
 Akeeba BKP = Yes
 DMC Firewall = Yes
 Brute Force Stop = No
---------------------------
System Data
 Joomla Version = 3.8.1
 PHP Version = 7.0.23

NOTE: the PlugIn uses Joomla Update System. If I change something about it you'll get the notify message in your admin area.

If you like to try (or improve) my PlugIn, you can download here below.
There is NO backlink, no ADV, no Logos... just PHP!
If you like to give me some feedbacks, please feel free to contact me!

Download latest PLG-Digitest-Debug ver. 1.0.5 (tested on Joomla 3.8.1, PHP 7.0.23)

Change Log

Ver 1.0.5: Multiple Admin IDs (28 Feb 2018);

Ver 1.0.4: Some improvements (09 Feb 2018);

Ver 1.0.3: MySQL issue by Add New Article (error: 1064) [SOLVED] (24 Oct 2017);

Ver 1.0.2: More parameters and new Responsive layout on two columns (20 Oct 2017);

Ver 1.0.1: Test version (18 Oct 2017);

Thanks, Fabrizio.

 
 
 
  • |
  • |
  • Modified: 03 / 10 / 2018