---
title: "How To Create Your First Snippet - Tassos Code Snippets"
description: "Follow the steps in this article to learn how to add your first custom code snippet in your Joomla site and what options you have.  Log in to your J"
url: "https://www.tassos.gr/docs/code-snippets/getting-started/create-first-snippet"
date: "2026-04-29T07:56:44+00:00"
language: "en-GB"
---

[ Home ](https://www.tassos.gr/index.php?option=com_content&view=category&layout=blog&id=24&Itemid=1088) / [ Tassos Code Snippets ](https://www.tassos.gr/index.php?option=com_content&view=category&id=120) / [ Getting Started ](https://www.tassos.gr/index.php?option=com_content&view=category&id=121)

#  How To Create Your First Snippet

Follow the steps in this article to learn how to add your first custom code snippet in your Joomla site and what options you have.

1. Log in to your Joomla administrator
2. Go to **Components → Tassos Code Snippets**
3. Click **New** to open the snippet editor, where you can configure your new snippet
4. The first thing you'll want to do is give your snippet a descriptive **Title**. A clear title makes it easy to find and manage your snippets later, especially when you have many of them. Choose something that clearly describes what the snippet does, for example: "Add Google Analytics", "Custom CSS for Mobile Menu", or "Hide Joomla Generator Tag".
5. Next, select the right type of code for your snippet from the **Code Type** dropdown. We support [7 snippet types](https://www.tassos.gr/docs/tassos-code-snippets/types):
    - Text
    - HTML
    - CSS
    - CSS External Files
    - JavaScript
    - JavaScript External Files
    - PHP
6. Understanding where to place your snippets is crucial for them to work correctly. We offer the following two main **Insertion Methods**:
    - To auto-insert the snippet to a predefined location, select **Auto-Insert**.
    - To insert the snippet manually via a shortcode, select **Shortcode**.
7. When using **Auto-Insert**, the available locations vary by snippet type. In most cases, the following locations will be available:
    - Site Header
    - Site Body
    - Site Footer
    - Admin Header
    - Admin Body
    - Admin Footer
    - After Article Title
    - Before Article Content
    - After Article Content
8. When using the **Shortcode** insertion method, place `{tcs snippet.alias}` anywhere Joomla processes content — in articles, modules, or component output.
9. Paste your code into the editor, which determines the type of snippet you are editing and will provide syntax highlighting to make your code easier to read and edit.
    - For HTML snippets, do not include `<html>`, `<head>`, or `<body>` wrapper tags — paste only the code fragment you want to inject.
    - For JavaScript snippets, do not include `<script>` tags.
    - For PHP snippets, do not include the opening &lt;?php or closing ?&gt; tags.
    - For CSS snippets, do not include `<style>` tags.
10. In the Snippet editor, you will find a tab called **Conditional Logic**, which allows you to create powerful rules to control when and where your snippet runs. You can target specific pages, users, devices, components, and much more. Leave it empty to run it site-wide. Learn more in [Using Snippet Logic](https://www.tassos.gr/docs/tassos-code-snippets/functionality/conditional-logic).
11. The last step is to save your snippet and set its status. In the right sidebar, you'll find the **Status** dropdown. Set it to **Published** to activate your snippet, **Unpublished** to temporarily disable it, or **Archived** to store it for future use.

## [Viewing Your Changes](#viewing-your-changes)

Visit your site's frontend to see your snippet in action. If you don't see changes immediately, try:

- Clearing your browser cache (Ctrl+Shift+R or Cmd+Shift+R)
- Clearing your Joomla cache (System → Clear Cache)
- Verifying your snippet is published

That's it! Now you know how to add snippets with Tassos Code Snippets.

## [Next Steps](#next-steps)

Congratulations! You've created your first code snippet. Now you can:

- Explore different [snippet types](https://www.tassos.gr/docs/tassos-code-snippets/types) to understand what each can do.
- Learn about [snippet locations](https://www.tassos.gr/docs/tassos-code-snippets/locations) to target specific areas.
- Set up [conditional logic](https://www.tassos.gr/docs/tassos-code-snippets/functionality/conditional-logic) to control when snippets run.
- Check out the [Recipes](https://www.tassos.gr/docs/tassos-code-snippets/recipes) for practical patterns.

If you run into any issues, check our [Troubleshooting guide](https://www.tassos.gr/docs/tassos-code-snippets/troubleshooting) for solutions to common problems.

 Last updated on Mar 3rd 2026 15:03

## Schema

```json
{
    "@context": "https://schema.org",
    "@type": "BreadcrumbList",
    "itemListElement": [
        {
            "@type": "ListItem",
            "position": 1,
            "name": "Home",
            "item": "https://www.tassos.gr"
        },
        {
            "@type": "ListItem",
            "position": 2,
            "name": "Home",
            "item": "https://www.tassos.gr/docs"
        },
        {
            "@type": "ListItem",
            "position": 3,
            "name": "Tassos Code Snippets",
            "item": "https://www.tassos.gr/docs/code-snippets"
        },
        {
            "@type": "ListItem",
            "position": 4,
            "name": "Getting Started",
            "item": "https://www.tassos.gr/docs/code-snippets/getting-started"
        },
        {
            "@type": "ListItem",
            "position": 5,
            "name": "How To Create Your First Snippet",
            "item": "https://www.tassos.gr/docs/code-snippets/getting-started/create-first-snippet"
        }
    ]
}
```

```json
{
    "@context": "https://schema.org",
    "@type": "Article",
    "mainEntityOfPage": {
        "@type": "WebPage",
        "@id": "https://www.tassos.gr/docs/code-snippets/getting-started/create-first-snippet"
    },
    "headline": "How To Create Your First Snippet",
    "image": {
        "@type": "ImageObject",
        "url": "https://www.tassos.gr/"
    },
    "publisher": {
        "@type": "Organization",
        "name": "Tassos",
        "logo": {
            "@type": "ImageObject",
            "url": "https://www.tassos.gr/https://www.tassos.gr/media/brand/logo-text.png"
        }
    },
    "author": {
        "@type": "Person",
        "name": "Tassos Marinos",
        "url": "https://www.tassos.gr/docs/code-snippets/getting-started/create-first-snippet"
    },
    "datePublished": "2026-03-02T14:36:58+02:00",
    "dateCreated": "2026-03-02T14:36:58+02:00",
    "dateModified": "2026-03-03T15:32:20+02:00"
}
```
