/redaxo-core:redaxo-templatesfrom redaxo-core
Authoring REDAXO CMS templates: page layouts with getArticle(), rex_fragment, multi-language output, and slice embedding. Useful when creating or editing templates.
Ships in redaxo-core. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Templates are the page layouts in REDAXO. They include the document shell (<html>, <head>, <body>) plus navigation, header/footer – and call getArticle() to render the article content built from modules.
Each article in the structure addon is assigned a template (with optional inheritance and category-based defaults).
<!DOCTYPE html>
<html lang="<?= rex_clang::getCurrent()->getCode() ?>">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><?= rex_escape(rex_article::getCurrent()->getName()) ?> – <?= rex_escape(rex::getServerName()) ?></title>
<link rel="stylesheet" href="<?= rex_url::frontend('assets/style.css') ?>">
</head>
<body>
<header>
<a href="<?= rex_getUrl(rex_article::getSiteStartArticleId()) ?>">
<?= rex_escape(rex::getServerName()) ?>
</a>
<?php // Navigation – see "Navigation" below ?>
</header>
<main>
<?php // Render all slices of the current article ?>
<?= REX_ARTICLE[] ?>
</main>
<footer>
<p>© <?= date('Y') ?> <?= rex_escape(rex::getServerName()) ?></p>
</footer>
</body>
</html>
REX_ARTICLE[] (the bracket placeholder) is the standard way to render the current article's slices. There's also REX_ARTICLE[id=5] to render a specific article inline.
REDAXO supports multiple languages via rex_clang. Each language has an ID, a code (e.g. de, en), and a name.
<html lang="<?= rex_clang::getCurrent()->getCode() ?>">
<?php // Language switcher ?>
<ul class="lang-switch">
<?php foreach (rex_clang::getAll(true) as $clang): ?>
<?php $url = rex_getUrl(null, $clang->getId()); ?>
<li class="<?= $clang->getId() === rex_clang::getCurrentId() ? 'active' : '' ?>">
<a href="<?= $url ?>" hreflang="<?= $clang->getCode() ?>">
<?= rex_escape($clang->getName()) ?>
</a>
</li>
<?php endforeach; ?>
</ul>
rex_getUrl(null, $clangId) keeps the current article but switches the language. rex_getUrl($articleId, $clangId) switches both.
The structure addon doesn't ship navigation builders; use one of these:
Manual recursion (small sites):
function renderNav(int $parentId = 0, int $maxDepth = 2, int $depth = 0): string
{
if ($depth >= $maxDepth) {
return '';
}
$items = rex_category::getChildrenById($parentId);
if (!$items) {
return '';
}
$html = '<ul class="nav-level-' . $depth . '">';
foreach ($items as $cat) {
if (!$cat->isOnline()) {
continue;
}
$current = $cat->getId() === rex_category::getCurrentId() ? ' class="active"' : '';
$html .= '<li' . $current . '>';
$html .= '<a href="' . $cat->getUrl() . '">' . rex_escape($cat->getName()) . '</a>';
$html .= renderNav($cat->getId(), $maxDepth, $depth + 1);
$html .= '</li>';
}
return $html . '</ul>';
}
echo renderNav();
Bootstrap-style menus: consider the bootstrap_components or jp_navtagger addons – they generate navigation HTML from the structure.
rex_fragment lets you split templates into reusable pieces. Looks for fragments under <addon>/fragments/ or in your project's fragments/ directory.
$f = new rex_fragment();
$f->setVar('title', $article->getName(), false);
$f->setVar('image', $heroImage);
echo $f->parse('hero.php');
In fragments/hero.php:
<section class="hero">
<h1><?= rex_escape($this->getVar('title')) ?></h1>
<?php if ($img = $this->getVar('image')): ?>
<img src="<?= rex_url::media($img) ?>" alt="">
<?php endif; ?>
</section>
Templates run on every request unless cached. For expensive lookups (DB queries, external APIs), use rex_extension::register('OUTPUT_FILTER', ...) for full-page caching, or store fragments via rex_file::put(rex_path::cache(...)).
rex_article::getSiteStartArticleId().lang attribute on <html> – breaks accessibility and SEO.$_SERVER['HTTP_HOST'] instead of rex::getServer() / rex_yrewrite::getCurrentDomain().rex_article::get() – it returns null.developer addon and expecting an immediate effect – template code (like module input/output) is served from the database (rex::getTable('template'), cached by rex_template_cache); the files (by default under redaxo/data/addons/developer/) are only a mirror. The addon syncs automatically on a web request only if sync_frontend/sync_backend is enabled (default) and debug mode is on or the request has an admin backend session – without debug mode, anonymous visitors never trigger it. Console commands never trigger it either, regardless of debug mode (boot.php returns before that check when running under console). Otherwise sync explicitly:
bin/console developer:sync # newer side wins; --force-files / --force-db pick a side
--force-files also deletes templates/modules from the database that have no directory. Prefer touch on the single file and a plain developer:sync – it wins the timestamp comparison for that one item without touching anything else. The redaxo-developer plugin covers the timestamp arbitration, the git pull trap and item creation from files in depth.What SKILL.md sets; muted values are Claude Code's defaults
11 skills in this plugin
/redaxo-addon-developmentBuilding and maintaining custom REDAXO addons – package.yml, boot.php, install/update/uninstall, lang files, fragments, backend pages, the assets pipeline (and the reinstall-to-sync rule), cache-busting on asset URLs, vendor dependencies, and the common-pitfalls checklist. Use when the user creates a new addon, edits package.yml, sets up backend pages, ships frontend assets from an addon, integrates Composer dependencies, or asks how to package functionality as a reusable addon./redaxo-api-functionsBuilding HTTP/AJAX endpoints in REDAXO using rex_api_function – the lib/ class location, naming convention, $published flag for frontend access, JSON responses, CORS for cross-domain widgets, and the rex-api-call URL. Use when the user adds an AJAX/HTTP endpoint to a custom addon, builds a JSON API for a frontend widget, or asks how to expose data via /index.php?rex-api-call=. Distinct from the FriendsOfRedaxo/api addon (covered by the redaxo-api-addon plugin)./redaxo-architectureREDAXO project structure, request lifecycle, and core classes. Use when the user works on a REDAXO codebase, mentions REDAXO directory layout, asks about rex_addon/rex_config/rex_path/rex_url/rex_clang/rex_request, or when files under redaxo/src/, redaxo/data/, or redaxo/cache/ appear in the conversation.npx claudepluginhub friendsofredaxo/claude-marketplace --plugin redaxo-coreOther plugins' skills for the same job