Theme Snippets logo

Theme Snippets

Community
ahmed-lakosha
theme-snippets

Complete Odoo website snippet reference and creation guide. Covers snippet architecture, 81+ static snippet templates (structure, gallery, features, dynamic, inner content, mega menus), dynamic snippets system, snippet options (we-* elements), custom snippet creation for Odoo 14-19, and version-aware registration (simple vs groups). <example> Context: User wants to create a custom snippet user: "Create a custom snippet for my Odoo website" assistant: "I will create a version-aware snippet with template, registration, and options." <commentary>Custom snippet creation.</commentary> </example> <example> Context: User wants to know available snippets user: "What snippets are available in Odoo?" assistant: "Odoo has 81+ static snippets across 6 categories." <commentary>Snippet inventory reference.</commentary> </example> <example> Context: User wants a dynamic snippet user: "Create a dynamic snippet that shows latest products" assistant: "I will create a dynamic snippet with filter, display template, and data source." <commentary>Dynamic snippet creation.</commentary> </example> <example> Context: User needs snippet options user: "Add customization options to my snippet" assistant: "I will create snippet_options XML with we-* elements." <commentary>Snippet options system.</commentary> </example>

Overview

Publisherahmed-lakosha
Repositoryodoo-plugins
Skill nametheme-snippets
Stars
74
Forks
33
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by ahmed-lakosha on GitHub. Read the source before you install it.

Installation

Install the Theme Snippets AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ahmed-lakosha/odoo-plugins.git /tmp/odoo-plugins
mkdir -p .claude/skills
cp -r /tmp/odoo-plugins/odoo-frontend-plugin/skills/theme-snippets .claude/skills/theme-snippets
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Theme Snippets in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Theme Snippets on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Theme Snippets is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Odoo Website Snippets Reference

Snippet Architecture

STATIC SNIPPETS (81+ templates)    DYNAMIC SNIPPETS (data-driven)
├── Pre-built HTML                  ├── ir.filters (data source)
├── Drag & drop                     ├── website.snippet.filter (fetcher)
└── 6 categories                    └── Display templates (renderer)

              SNIPPET OPTIONS SYSTEM
              we-select | we-button | we-colorpicker | we-input
              data-selector | data-select-class | data-js

Static Snippets Inventory (81+ Templates)

Structure (14)

IDNameBest For
s_bannerBannerLanding pages
s_coverCoverHeaders
s_text_imageText - ImageFeatures
s_image_textImage - TextFeatures
s_titleTitleSection headers
s_text_blockText BlockContent
s_numbersNumbersAchievements
s_three_columnsColumnsContent grids
s_featuresFeaturesBenefits
s_masonry_blockMasonryGalleries
s_image_galleryImage GalleryPortfolios

Features (11)

IDNameBest For
s_comparisonsComparisonsProduct comparison
s_company_teamTeamAbout pages
s_call_to_actionCTAConversions
s_referencesReferencesSocial proof
s_accordionAccordionFAQs
s_features_gridFeatures GridBenefits
s_pricelistPricelistProducts
s_faq_collapseFAQSupport
s_tabsTabsOrganization

Dynamic Content (15)

IDNameBest For
s_google_mapGoogle MapContact pages
s_website_formFormLead capture
s_social_mediaSocial MediaEngagement
s_dynamic_snippetDynamicData display
s_countdownCountdownEvents
s_popupPopupPromotions
s_newsletter_blockNewsletterMarketing

Inner Content (16)

IDNameBest For
s_cardCardItems
s_three_cards / s_four_cardsCardsServices/Features
s_timelineTimelineHistory
s_process_stepsStepsTutorials
s_quotes_carouselTestimonialsSocial proof
s_blockquoteBlockquoteEmphasis

Mega Menus (9)

IDName
s_mega_menu_multi_menusMultiple menu columns
s_mega_menu_cardsCard-style menu
s_mega_menu_big_iconsLarge icon menu
s_mega_menu_thumbnailsThumbnail gallery

Creating Custom Snippets

Odoo 14-17: Simple Registration

xml
<!-- 1. Snippet Template -->
<template id="s_my_snippet" name="My Snippet">
    <section class="s_my_snippet pt48 pb48 o_cc o_cc1">
        <div class="container">
            <div class="row">
                <div class="col-lg-12 text-center">
                    <h2>My Custom Snippet</h2>
                    <p>Content goes here...</p>
                </div>
            </div>
        </div>
    </section>
</template>

<!-- 2. Registration -->
<template id="s_my_snippet_insert" inherit_id="website.snippets">
    <xpath expr="//div[@id='snippet_structure']//t[@t-snippet][last()]" position="after">
        <t t-snippet="my_module.s_my_snippet"
           t-thumbnail="/my_module/static/src/img/snippets/s_my_snippet.svg">
            <keywords>my, custom, snippet</keywords>
        </t>
    </xpath>
</template>

Odoo 18-19: With Snippet Groups (Required)

xml
<!-- 1. Snippet Template (same as above) -->

<!-- 2. Custom Group (optional) -->
<template id="snippet_group_custom" inherit_id="website.snippets">
    <xpath expr="//div[@id='snippet_groups']" position="inside">
        <t snippet-group="custom"
           t-snippet="website.s_snippet_group"
           string="Custom Snippets"/>
    </xpath>
</template>

<!-- 3. Registration with Group -->
<template id="s_my_snippet_insert" inherit_id="website.snippets">
    <xpath expr="//div[@id='snippet_structure']/*[1]" position="before">
        <t t-snippet="my_module.s_my_snippet"
           string="My Snippet"
           group="custom"
           t-thumbnail="/my_module/static/src/img/snippets/s_my_snippet.svg"/>
    </xpath>
</template>

Panel Categories

Panel IDCategoryXPath
snippet_structureStructure//div[@id='snippet_structure']
snippet_mediaGallery//div[@id='snippet_media']
snippet_featureFeatures//div[@id='snippet_feature']
snippet_dynamicDynamic//div[@id='snippet_dynamic']
snippet_inner_contentInner Content//div[@id='snippet_inner_content']

Snippet Options System

We-* Elements

ElementPurposeKey Attributes
we-selectDropdowndata-name, data-dependencies
we-buttonToggledata-select-class, data-toggle-class
we-colorpickerColor pickerdata-css-property
we-inputText/numberdata-attribute-name, data-unit
we-rangeSliderdata-min, data-max, data-step
we-checkboxToggledata-select-class

Data Attributes

AttributePurpose
data-selectorTarget CSS selector
data-select-classToggle CSS class
data-css-propertyCSS property to modify
data-jsJavaScript handler class
data-dependenciesConditional visibility
data-no-previewDisable live preview

Complete Options Example

xml
<template id="s_my_snippet_options" inherit_id="website.snippet_options">
    <xpath expr="." position="inside">
        <div data-js="MySnippetHandler"
             data-selector=".s_my_snippet"
             data-drop-in=".oe_structure">

            <we-select string="Layout" data-name="layout_opt">
                <we-button data-select-class="layout-grid">Grid</we-button>
                <we-button data-select-class="layout-list">List</we-button>
            </we-select>

            <we-colorpicker string="Background"
                            data-select-style="true"
                            data-css-property="background-color"/>

            <we-range string="Spacing"
                      data-select-style="true"
                      data-css-property="gap"
                      data-min="0" data-max="100" data-step="5" data-unit="px"/>
        </div>
    </xpath>
</template>

Built-in JS Handlers

BackgroundImage, BackgroundPosition, BackgroundToggler, ColoredLevelBackground, BackgroundShape, ImageTools, Carousel, DynamicSnippet


Dynamic Snippets

Architecture

Data Source (ir.filters) → Filter (website.snippet.filter) → Display Template

Creating a Dynamic Snippet

Step 1: Define Filter

xml
<record id="dynamic_filter_my_items" model="website.snippet.filter">
    <field name="name">My Items</field>
    <field name="model_name">my.model</field>
    <field name="limit">12</field>
    <field name="filter_id" ref="ir_filter_my_items"/>
</record>

Step 2: Display Template

xml
<template id="dynamic_filter_template_my_model_card" name="Card">
    <t t-foreach="records" t-as="record">
        <div class="col-lg-4 mb-4">
            <div class="card h-100 shadow-sm">
                <img t-att-src="record.image_url" class="card-img-top"/>
                <div class="card-body">
                    <h5 class="card-title" t-esc="record.name"/>
                </div>
            </div>
        </div>
    </t>
</template>

Step 3: Dynamic Snippet

xml
<template id="s_dynamic_my_items" name="Dynamic My Items">
    <section class="s_dynamic_snippet s_dynamic_my_items pt48 pb48"
             data-snippet="s_dynamic_my_items"
             data-filter-id="my_module.dynamic_filter_my_items"
             data-template-key="my_module.dynamic_filter_template_my_model_card"
             data-number-of-elements="6">
        <div class="container">
            <div class="dynamic_snippet_template row"/>
        </div>
    </section>
</template>

Product Dynamic Snippets (website_sale)

Filters: dynamic_filter_newest_products, dynamic_filter_recently_sold_products, dynamic_filter_recently_viewed_products

Display templates: card_style, centered, horizontal_card, mini, minimalist_*, banner


Snippet JavaScript

publicWidget for Snippets

javascript
/** @odoo-module **/
import publicWidget from "@web/legacy/js/public/public_widget";

publicWidget.registry.MySnippet = publicWidget.Widget.extend({
    selector: '.s_my_snippet',
    disabledInEditableMode: false,

    start: function () {
        if (!this.editableMode) {
            this._initializeAnimations();
        }
        return this._super(...arguments);
    },

    destroy: function () {
        $(window).off('.mySnippet');
        this._super(...arguments);
    },
});

Snippet Options Handler

javascript
/** @odoo-module **/
import options from "@web_editor/js/editor/snippets.options";

options.registry.MySnippetOption = options.Class.extend({
    selectDataAttribute: function(previewMode, widgetValue, params) {
        this._super(...arguments);
        if (params.attributeName === 'layout') {
            this._applyLayout(widgetValue);
        }
    },
});

Version Differences

FeatureOdoo 14-17Odoo 18-19
RegistrationSimple XPathGroups required
JavaScript@odoo-modulePlugin-based (19)
Bootstrap4.x (14-15) / 5.1.3 (16-17)5.1.3
Dynamic SnippetsBasicFull + Categories

Odoo 19 Plugin Pattern

javascript
import { Plugin } from "@html_editor/plugin";
import { registry } from "@web/core/registry";

export class MySnippetPlugin extends Plugin {
    static id = "mySnippet";
    resources = {
        builder_options: [{
            template: "my_module.MySnippetOption",
            selector: "section",
            applyTo: ".s_my_snippet",
        }],
    };
}
registry.category("website-plugins").add("mySnippet", MySnippetPlugin);

Frequently asked questions

What does the Theme Snippets AI skill do?

Complete Odoo website snippet reference and creation guide. Covers snippet architecture, 81+ static snippet templates (structure, gallery, features, dynamic, inner content, mega menus), dynamic snippets system, snippet options (we-* elements), custom snippet creation for Odoo 14-19, and version-aware registration (simple vs groups). <example> Context: User wants to create a custom snippet user: "Create a custom snippet for my Odoo website" assistant: "I will create a version-aware snippet with template, registration, and options." <commentary>Custom snippet creation.</commentary> </example>...

Why use Theme Snippets on TypingMind?

Because you install it once and use it with any model. Theme Snippets is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Theme Snippets in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/ahmed-lakosha/odoo-plugins/tree/master/odoo-frontend-plugin/skills/theme-snippets. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Theme Snippets?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Theme Snippets?

As many as you like. As long as a model supports skills, you can use Theme Snippets with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Theme Snippets AI skill free?

Yes. It is published on GitHub by ahmed-lakosha under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇