/redaxo-structure:structure-meta-infofrom redaxo-structure
Adds custom metadata fields to articles, categories, media, and languages via REDAXO's meta_info plugin. Covers backend configuration, prefix conventions, and programmatic read/write operations.
Ships in redaxo-structure. 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.
The structure/meta_info plugin (ships with the structure addon) lets you add custom fields to:
art_* prefix)cat_* prefix)med_* prefix)clang_* prefix)Fields are configured in the backend (Structure → Meta-Information). Each field has a name (matches the SQL column), a label, a type (text, textarea, select, radio, checkbox, media/medialist/link/linklist picker, date, datetime, time, legend), and an optional default. The full list of type_id constants lives in rex_metainfo_default_type — see the redaxo-metainfo-fields skill for the reference table.
The prefix tells REDAXO which entity it belongs to – art_my_field adds a column to rex_article, cat_my_field adds it to rex_article (categories share the table), med_my_field extends rex_media.
// On articles
$article = rex_article::getCurrent();
$value = $article->getValue('art_subtitle');
// On categories
$cat = rex_category::getCurrent();
$value = $cat->getValue('cat_color');
// On media
$media = rex_media::get('hero.jpg');
$copyright = $media->getValue('med_copyright');
// On clang
$clang = rex_clang::getCurrent();
$value = $clang->getValue('clang_currency');
getValue() returns the raw column value as a string. Cast as needed:
$boolField = (bool) (int) $article->getValue('art_featured');
$intField = (int) $article->getValue('art_priority_score');
Through the article/category service so changes are tracked:
rex_article_service::editArticle($articleId, $clangId, [
'art_subtitle' => 'A new subtitle',
'art_featured' => 1,
]);
For media, use rex_media_service::updateMedia(). For clang, write directly via rex_sql (no service wrapper exists for clang updates):
$sql = rex_sql::factory();
$sql->setTable(rex::getTable('clang'));
$sql->setWhere(['id' => $clangId]);
$sql->setValue('clang_currency', 'EUR');
$sql->update();
rex_clang::reset(); // clear in-process clang cache
The meta_info plugin exposes a small API for declaring fields without clicking through the backend. This is the right approach for distributable addons.
The target table is derived from the field name's prefix (art_* → articles, cat_* → categories, med_* → media, clang_* → languages); there is no explicit table argument. Parameter order is (title, name, priority, attributes, type, default, params, validate, restrictions, callback):
<?php
// install.php
if (rex_plugin::get('structure', 'meta_info')->isAvailable()) {
rex_metainfo_add_field(
'Subtitle', // $title (backend label)
'art_subtitle', // $name (prefix decides the target table)
100, // $priority
'', // $attributes (raw input attrs)
rex_metainfo_default_type::TEXT, // $type
'', // $default
null, // $params (option list for SELECT/RADIO/CHECKBOX)
null, // $validate
'', // $restrictions (role/perm string, '' = visible to all)
);
}
The full constants list is in the redaxo-metainfo-fields skill. For an idempotent re-runnable variant (the function silently no-ops if the field already exists), see the pattern documented there.
To remove a field on uninstall:
<?php
// uninstall.php
if (rex_plugin::get('structure', 'meta_info')->isAvailable()) {
rex_metainfo_delete_field('art_subtitle');
}
YRewrite ships these by default; they're already added when YRewrite is installed:
art_yrewrite_title – page title overrideart_yrewrite_description – meta descriptionart_yrewrite_index – index / noindexart_yrewrite_canonical_url – canonical overrideart_yrewrite_image – social-share image (REX_MEDIA_WIDGET)Don't redefine them in your own addon.
Meta fields are real columns on rex_article (or rex_media/rex_clang), so you can query them with rex_sql:
$sql = rex_sql::factory();
$sql->setQuery(
'SELECT id FROM ' . rex::getTable('article') . '
WHERE clang_id = :clang
AND status = 1
AND art_featured = 1
ORDER BY priority',
['clang' => rex_clang::getCurrentId()]
);
For dropdowns (type_id 3) the value stored is the option key, not the label. Decoding labels requires re-reading the field config:
$sql = rex_sql::factory();
$sql->setQuery(
'SELECT params FROM ' . rex::getTable('metainfo_field') . '
WHERE name = ?',
['art_status']
);
$params = $sql->getValue('params'); // "1,Draft|2,Review|3,Published"
subtitle won't work; it must be art_subtitle.rex_sql directly instead of rex_metainfo_add_field – the form in the backend doesn't show them.ensureColumn() first.params or store labels redundantly.What SKILL.md sets; muted values are Claude Code's defaults
4 skills in this plugin
/structure-articlesWorking with REDAXO articles via rex_article – fetching, listing, status, dates, URLs, and the start/notfound/site articles. Use when the user reads or modifies article data, builds article lists for templates, queries the structure tree, or handles per-language article variants./structure-categoriesWorking with REDAXO categories via rex_category – tree traversal, navigation building, parents/children, current path. Use when the user builds navigation menus, breadcrumbs, sitemaps, or queries the category structure of a REDAXO site./structure-contentnpx claudepluginhub friendsofredaxo/claude-marketplace --plugin redaxo-structureOther plugins' skills for the same job