Shopware Cms Elements logo

Shopware Cms Elements

Community
alpham8
shopware-cms-elements

Use when building custom CMS elements or blocks for Shopware 6 Erlebniswelten — element registration, admin component and config, data resolver, and storefront template. Triggers on CmsElementResolver, Shopware.Service cmsService, registerCmsElement, or shopping experience extensions.

Overview

Publisheralpham8
Repositoryagentic-webdev
Skill nameshopware-cms-elements
Stars
4
Forks
0
Bundled files
Instructions only
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 alpham8 on GitHub. Read the source before you install it.

Installation

Install the Shopware Cms Elements 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.
    https://github.com/alpham8/agentic-webdev/tree/master/skills/shopware-cms-elements
  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/alpham8/agentic-webdev.git /tmp/agentic-webdev
mkdir -p .claude/skills
cp -r /tmp/agentic-webdev/skills/shopware-cms-elements .claude/skills/shopware-cms-elements
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Shopware Cms Elements 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 Shopware Cms Elements 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 Shopware Cms Elements 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.

Shopware 6 — Custom CMS Elements

See the shopware-administration skill for the admin side and the shopware skill for the map of Shopware skills.

Custom CMS Elements (Erlebniswelten)

Custom CMS elements require a PHP DataResolver, a DI registration, and an admin JS module.

PHP — Two Resolver Patterns

Pattern A — Extend TextCmsElementResolver (text/content fields):

php
use Shopware\Core\Content\Cms\DataResolver\Element\TextCmsElementResolver;

class HeadlineCmsElementResolver extends TextCmsElementResolver
{
    public function getType(): string { return 'lnx-headline'; }
}

DI: inject Shopware\Core\Framework\Util\HtmlSanitizer as first argument.

Pattern B — Implement CmsElementResolverInterface (elements needing DAL queries):

php
use Shopware\Core\Content\Cms\DataResolver\Element\CmsElementResolverInterface;
use Shopware\Core\Content\Cms\DataResolver\Element\ElementDataCollection;
use Shopware\Core\Content\Cms\DataResolver\ResolverContext\ResolverContext;
use Shopware\Core\Framework\Struct\ArrayStruct;

class PdfSectionCmsElementResolver implements CmsElementResolverInterface
{
    public function __construct(
        private readonly EntityRepository $mediaFolderRepository,
        private readonly EntityRepository $mediaRepository,
    ) {}

    public function getType(): string { return 'lnx-pdf-katalog-section'; }

    public function collect(CmsSlotEntity $slot, ResolverContext $resolverContext): ?CriteriaCollection
    {
        return null; // resolve everything in enrich()
    }

    public function enrich(CmsSlotEntity $slot, ResolverContext $resolverContext, ElementDataCollection $result): void
    {
        $folderName = (string) ($slot->getFieldConfig()->get('folderName')?->getValue() ?? '');

        if ($folderName === '') {
            $slot->setData(new ArrayStruct(['media' => []]));
            return;
        }

        $context = $resolverContext->getSalesChannelContext()->getContext();
        // ... DAL queries ...
        $slot->setData(new ArrayStruct(['media' => $media->getElements()]));
    }
}
DI Registration (cms.xml)
xml
<service id="Vendor\Plugin\...\HeadlineCmsElementResolver">
    <argument type="service" id="Shopware\Core\Framework\Util\HtmlSanitizer" />
    <tag name="shopware.cms.data_resolver" />
</service>

<service id="Vendor\Plugin\...\PdfSectionCmsElementResolver">
    <argument type="service" id="media_folder.repository" />
    <argument type="service" id="media.repository" />
    <tag name="shopware.cms.data_resolver" />
</service>

Tag: shopware.cms.data_resolver — required on every resolver.

Admin JS Structure
module/sw-cms/
├── index.js                        ← imports all elements
└── element/
    └── lnx-headline/
        ├── index.js                ← registerCmsElement() + component registration
        ├── component/index.js
        ├── config/index.js
        └── preview/index.js

element/lnx-headline/index.js:

javascript
Shopware.Component.register('lnx-cms-el-headline', () => import('./component'));
Shopware.Component.register('lnx-cms-el-config-headline', () => import('./config'));
Shopware.Component.register('lnx-cms-el-preview-headline', () => import('./preview'));

Shopware.Service('cmsService').registerCmsElement({
    name: 'lnx-headline',
    label: 'sw-cms.elements.headline.label',
    component: 'lnx-cms-el-headline',
    configComponent: 'lnx-cms-el-config-headline',
    previewComponent: 'lnx-cms-el-preview-headline',
    defaultConfig: {
        content: { source: 'static', value: 'Lorem ipsum dolor sit amet.' },
        level:   { source: 'static', value: 'h1' },
    },
});

Component/config index.js — always call initElementConfig():

javascript
import { Mixin } = Shopware;
export default {
    template,
    mixins: [Mixin.getByName('cms-element')],
    created() {
        this.initElementConfig('lnx-headline'); // must be called in BOTH component and config
    },
};

Auto-mapping (product.name / category.name based on page type):

javascript
created() {
    this.initElementConfig('lnx-headline');
    const pageType = this.cmsPageState?.currentPage?.type ?? '';
    if (pageType === 'product_detail' && !this.element?.translated?.config?.content) {
        this.element.config.content.source = 'mapped';
        this.element.config.content.value = 'product.name';
    } else if (pageType === 'product_list' && !this.element?.translated?.config?.content) {
        this.element.config.content.source = 'mapped';
        this.element.config.content.value = 'category.name';
    }
},

Storefront template (Resources/views/storefront/element/cms-element-lnx-headline.html.twig):

twig
{% block element_lnx_headline %}
    <{{ element.config.level.value }}>{{ element.data.content }}</{{ element.config.level.value }}>
{% endblock %}

Access slot config via element.config.*, resolved data via element.data.*.

Key Rules
  • Element name in registerCmsElement must exactly match PHP getType().
  • initElementConfig() must be called in both component and config.
  • source: 'static' for user-entered values; source: 'mapped' for entity field references.
  • Config field values in PHP: $slot->getFieldConfig()->get('fieldName')?->getValue().
CMS Block

Blocks define layout structure (which elements go in which slots). Register with registerCmsBlock:

javascript
Shopware.Service('cmsService').registerCmsBlock({
    name: 'image-text-reversed',
    category: 'text-image',    // text | image | text-image | commerce | form | video | sidebar
    label: 'cms.blocks.imageTextReversed.label',
    component: 'cms-block-image-text-reversed',
    previewComponent: 'cms-block-preview-image-text-reversed',
    defaultConfig: { marginBottom: '20px', marginTop: '20px', sizingMode: 'boxed' },
    slots: { left: 'text', right: 'image' },
});

Storefront block template (storefront/block/cms-block-image-text-reversed.html.twig):

twig
<div class="col-md-6">
    {% set element = block.slots.getSlot('left') %}
    {% sw_include '@Storefront/storefront/element/cms-element-' ~ element.type ~ '.html.twig' with { 'element': element } %}
</div>
<div class="col-md-6">
    {% set element = block.slots.getSlot('right') %}
    {% sw_include '@Storefront/storefront/element/cms-element-' ~ element.type ~ '.html.twig' with { 'element': element } %}
</div>

Frequently asked questions

What does the Shopware Cms Elements AI skill do?

Use when building custom CMS elements or blocks for Shopware 6 Erlebniswelten — element registration, admin component and config, data resolver, and storefront template. Triggers on CmsElementResolver, Shopware.Service cmsService, registerCmsElement, or shopping experience extensions.

Why use Shopware Cms Elements on TypingMind?

Because you install it once and use it with any model. Shopware Cms Elements 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 Shopware Cms Elements in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/alpham8/agentic-webdev/tree/master/skills/shopware-cms-elements. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Shopware Cms Elements?

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 Shopware Cms Elements?

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

Is the Shopware Cms Elements AI skill free?

It is published on GitHub by alpham8. Check the repository for licensing terms. 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 👇