Sourcerer by Regular Labs is a powerful and versatile Joomla system plugin designed to integrate custom code directly into your Joomla content. Here’s a detailed overview of what Sourcerer does and its key features:
What Sourcerer Does
Sourcerer allows you to insert PHP, HTML, CSS, and JavaScript code into various components of your Joomla site, including articles, categories, modules, components, and even the head of the HTML page. This capability eliminates the limitations often imposed by standard Joomla text editors, which may strip out certain types of code.
Key Features and Functionality
Code Integration
Sourcerer enables you to place custom code directly within your content using its editor button plugin. You can surround your code with Sourcerer plugin tags to ensure it is executed correctly.
Multi-Code Support
The plugin supports multiple types of code:
- HTML: Insert HTML code directly into articles or custom modules.
- CSS: Add CSS attributes directly to articles or link to external CSS files for specific styling overrides.
- JavaScript: Include JavaScript code either inline or by linking to external .js files, which can be added to the page head.
- PHP: Execute PHP scripts within your content, accessing Joomla objects and variables such as session data, user data, and database connections.
Ease of Use
Sourcerer is designed to be user-friendly, with a simple interface that includes tabs for different code types (Code, CSS, JavaScript, and PHP). This makes it easy to manage and insert various types of code into your content.
Access to Joomla Objects and Variables
When using PHP code, Sourcerer automatically creates commonly used Joomla objects and variables, such as `$app`, `$document`, `$database`, and `$user`, making it easier to interact with Joomla’s framework and database.
Database Interaction
You can perform database calls using Joomla’s built-in database object and functions. Sourcerer initializes the necessary database objects, allowing you to execute queries and manipulate data directly from your content.
Flexibility and Versatility
Sourcerer is not limited to articles; it can be used in categories, modules, components, and other areas of your Joomla site. This flexibility makes it a valuable tool for customizing and enhancing the functionality of your site.
In summary, Sourcerer by Regular Labs is an essential tool for Joomla users who need to integrate custom code into their content without the restrictions typically imposed by standard text editors. Its ease of use, comprehensive support for various code types, and seamless integration with Joomla’s framework make it a powerful and indispensable extension for any Joomla site.