Snippet Types Overview
Tassos Code Snippets supports multiple snippet types, each designed for specific use cases. Understanding which type to use for your needs is key to getting the most out of the component.
Text
Text snippets are designed for administrators who want to add reusable, formatted content to their Joomla site without writing HTML. Use a Text snippet when you need to insert a paragraph, heading, formatted notice, or any block of copy that may appear in multiple places — such as a disclaimer, a promotional message, or a standard boilerplate. The content is written using Joomla's default WYSIWYG editor, so no coding knowledge is required.
Read more in the Text Snippets documentation.
HTML
HTML snippets are most useful when you want to quickly add third-party code to your site by simply copying and pasting what a provider gives you. This covers a wide range of common tasks: adding tracking scripts like Google Analytics or Facebook Pixel, embedding chat widgets like Intercom or Crisp, inserting iframes, displaying ads, or adding structured data markup for SEO. If the code you're adding is a mix of HTML tags and inline scripts, HTML is the right type to reach for.
Read more in the HTML Snippets documentation.
CSS
CSS snippets let you apply custom styles to your Joomla site without editing template files directly. They are ideal for any visual customisation that doesn't require loading an external file, things like tweaking fonts and colours, adjusting spacing, hiding or showing specific elements, fixing layout issues introduced by a template or third-party extension, or adding responsive design adjustments for mobile devices.
Read more in the CSS Snippets documentation.
CSS External Files
CSS External File snippets let you load a stylesheet from a remote URL, typically a CDN, with a single line. This is the go-to type for adding Google Fonts, loading icon libraries like Font Awesome or Material Icons, including CSS frameworks like Bootstrap or Tailwind, or referencing any external stylesheet your site depends on, without hardcoding a <link> tag into your template.
Read more in the CSS External Files documentation.
JavaScript
JavaScript snippets are designed for writing and running custom client-side code that enhances your site's behaviour and interactivity. Common applications include setting up analytics and event tracking, implementing cookie consent logic, adding custom form validation, building interactive UI elements, or running any JavaScript that needs to execute on page load. If you're writing the code yourself rather than loading it from an external source, this is your type.
Read more in the JavaScript Snippets documentation.
JavaScript External Files
JS External File snippets load JavaScript libraries or scripts from a remote URL, with support for defer and async loading attributes. This type is best when you need to include a third-party library from a CDN — such as jQuery, a jQuery plugin, a charting library, a heatmap tool, or any hosted script — without embedding the code directly into your snippet.
Read more in the JavaScript External Files documentation.
PHP
PHP snippets execute server-side code during Joomla's page generation cycle, before any HTML is sent to the browser. They are suited for tasks that require access to Joomla's internals: setting up custom redirects, querying the database, modifying how Joomla behaves on specific pages, integrating with external APIs, or running any logic that must happen on the server rather than in the browser.
Read more in the PHP Snippets documentation.