/redaxo-core:redaxo-metainfo-fieldsfrom redaxo-core
Defines and manages REDAXO metainfo fields (cat_*, art_*, med_*) with SELECT/RADIO/CHECKBOX params separator rules, SQL-query escape hatch, and idempotent setup scripts.
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.
Metainfo fields add custom columns to core tables: art_* and cat_* fields to rex_article (categories are stored there too), med_* to rex_media, clang_* to rex_clang. They show up in the article/category/media edit forms in the backend and are read with rex_article::getValue('art_<name>'), rex_category::getValue('cat_<name>'), rex_media::getValue('med_<name>'), rex_clang::getValue('clang_<name>').
params separator gotcha (SELECT / RADIO / CHECKBOX)When defining metainfo SELECT/RADIO/CHECKBOX fields via rex_metainfo_add_field(...) (or via the backend "Meta Infos" UI), the params string uses two separators that are easy to confuse:
| separates options: separates a single option's key:labelA literal comma is part of the option string — it is not a separator.
// ✅ Correct — Yes/No dropdown with empty placeholder
$params = ':–|1:Ja';
// └┬┘ └┬─┘
// │ └── option 2: key=1, label="Ja"
// └────── option 1: key="", label="–"
// ✅ Correct — three options
$params = '1:Tag|2:Woche|3:Monat';
// ❌ Wrong — comma is treated as part of the label
$params = '|–,1|Ja'; // produces 3 broken options: "", "–,1", "Ja"
Source of truth: addons/metainfo/lib/handler/handler.php — the parser does explode('|', $params) then explode(':', $valueGroup, 2).
If params parses as a SELECT ... query, REDAXO loads options from the DB instead of treating it as a literal list. Useful for dynamic dropdowns:
$params = 'SELECT id, name FROM ' . rex::getTable('team_role') . ' ORDER BY name';
The first column becomes the option key, the second becomes the label.
rex_metainfo_add_field() has a non-obvious parameter order — the target table is derived from the field name's prefix (art_* → articles, cat_* → categories, med_* → media, clang_* → languages), there's no explicit table argument.
rex_metainfo_add_field(
string $title, // backend label
string $name, // column name WITH prefix, e.g. 'cat_in_navi_top'
int $priority, // display order in the backend form
string $attributes, // raw input attributes, e.g. 'class="form-control"'
int $type, // type_id — see table below
string $default, // default value (still a string)
?string $params = null, // SELECT/RADIO/CHECKBOX options OR a SELECT-query
?string $validate = null,
string $restrictions = '',
?string $callback = null,
);
rex_metainfo_add_field() only adds — if a field or column with that name already exists it returns the error message rex_i18n::msg('minfo_field_error_unique_name') (a string) instead of true, and it doesn't update params/default/etc. on subsequent runs. For setup scripts that should be safe to re-run:
$tableName = rex::getTable('metainfo_field');
$existing = rex_sql::factory()->getArray(
'SELECT id, params FROM ' . $tableName . ' WHERE name = :name',
['name' => 'cat_in_navi_top']
);
if (empty($existing)) {
$result = rex_metainfo_add_field(
'In top navi', // $title (backend label)
'cat_in_navi_top', // $name (must start with cat_/art_/med_/clang_)
100, // $priority
'', // $attributes
rex_metainfo_default_type::SELECT, // $type
'', // $default
':–|1:Ja', // $params (option list)
);
if (true !== $result) {
throw new rex_exception('metainfo field setup failed: ' . $result);
}
} elseif ($existing[0]['params'] !== ':–|1:Ja') {
// UPDATE the row directly to fix params on an existing field
rex_sql::factory()
->setTable($tableName)
->setWhere(['id' => $existing[0]['id']])
->setValue('params', ':–|1:Ja')
->update();
}
rex_navigation has addFilter() for narrowing the rendered tree to categories matching a metainfo value:
$nav = rex_navigation::factory();
$nav->addFilter('cat_in_navi_top', 1, '='); // matches stored value '1'
$nav->get(0, 1, true, true);
addFilter does a strict == against $category->getValue('cat_in_navi_top') — so the empty option (key "") naturally filters out, only categories with value '1' pass through.
:–|) for the empty placeholder – the dropdown has no "blank" first option, so categories without a chosen value can't show "(none)".rex_metainfo_add_field() twice with the same name and expecting the second call to update – it returns the minfo_field_error_unique_name message instead. Check the return value with === true.params value that returns more than 2 columns – everything past the second column is ignored.addFilter('cat_x', 1) (no operator) when stored values are strings – 1 != '1' in some configurations. Pass the value as the same type as stored, or use = operator.be_manager_relation (via YForm) is more powerful for FK relationships. Reserve metainfo for simple, structure-page-level annotations.Source of truth: rex_metainfo_default_type (addons/metainfo/lib/default_type.php). Prefer the constants over the raw integers — they survive any future re-ordering.
type_id | Constant | Field type |
|---|---|---|
| 1 | rex_metainfo_default_type::TEXT | Text |
| 2 | rex_metainfo_default_type::TEXTAREA | Textarea |
| 3 | rex_metainfo_default_type::SELECT | Select |
| 4 | rex_metainfo_default_type::RADIO | Radio |
| 5 | rex_metainfo_default_type::CHECKBOX | Checkbox |
| 6 | rex_metainfo_default_type::REX_MEDIA_WIDGET | Media picker (single) |
| 7 | rex_metainfo_default_type::REX_MEDIALIST_WIDGET | Media picker (multi) |
| 8 | rex_metainfo_default_type::REX_LINK_WIDGET | Link picker (single) |
| 9 | rex_metainfo_default_type::REX_LINKLIST_WIDGET | Link picker (multi) |
| 10 | rex_metainfo_default_type::DATE | Date |
| 11 | rex_metainfo_default_type::DATETIME | Datetime |
| 12 | rex_metainfo_default_type::LEGEND | Legend (display-only separator) |
| 13 | rex_metainfo_default_type::TIME | Time |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub friendsofredaxo/claude-marketplace --plugin redaxo-core11 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.Other plugins' skills for the same job