Token导航 LogoToken导航TokenDH.com
前端设计只读github未标认证来源可访问许可证需确认审计通过

elementor-controls元素控制

Agent Skill

elementor-controls 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

380

周安装

16

GitHub Stars

3

下载量

133
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:elementor-controls(元素控制)
来源仓库:https://github.com/peixotorms/odinlayer-skills
仓库路径:skills/elementor-controls
安装命令:
npx skills add https://github.com/peixotorms/odinlayer-skills --skill elementor-controls
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/peixotorms/odinlayer-skills --skill elementor-controls

简介

elementor-controls 提供 Elementor 控件注册与配置的技术参考文档。

  • 适用于开发自定义控件、扩展 Elementor 编辑器功能或调试界面设置。
  • 通过 npx skills add 命令从 GitHub 安装,需确认仓库权限与网络访问能力。
  • 使用前应核实维护状态及是否涉及文件读写、命令执行等敏感操作。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Elementor Controls Reference

1. Controls Overview

Controls are the fields in the Elementor editor panel that allow users to configure widgets. Every control must live inside a section.

Basic pattern:

$this->start_controls_section('section_id', [
    'label' => esc_html__('Section', 'textdomain'),
    'tab' => \Elementor\Controls_Manager::TAB_CONTENT, // or TAB_STYLE
]);

$this->add_control('control_id', [
    'label' => esc_html__('Label', 'textdomain'),
    'type' => \Elementor\Controls_Manager::TEXT,
    'default' => '',
]);

$this->end_controls_section();

Control base classes:

Base ClassPurposeExamples
Base_Data_ControlControls that store a single valueTEXT, SELECT, COLOR, SWITCHER, NUMBER
Control_Base_MultipleControls returning arraysURL, MEDIA, ICONS, IMAGE_DIMENSIONS
Control_Base_UnitsControls with size + unitSLIDER, DIMENSIONS
Base_UI_ControlDisplay-only, no stored dataHEADING, DIVIDER, ALERT, RAW_HTML
Group_Control_BaseGrouped sets of controlsTypography, Background, Border

Available tabs: TAB_CONTENT, TAB_STYLE, TAB_ADVANCED, TAB_RESPONSIVE, TAB_LAYOUT

Common parameters (all controls): label, description, show_label (bool), label_block (bool), separator (default|before|after), condition, conditions, classes, dynamic, global, frontend_available

2. Data Controls Quick Reference

Full PHP code examples for all data controls: see resources/data-controls-examples.md

Text Input Controls

ControlConstantReturnsKey Params
TextTEXTstringinput_type, placeholder, title
TextareaTEXTAREAstringrows, placeholder
WYSIWYGWYSIWYGstring(rich text editor)
CodeCODEstringlanguage (html\css\javascript), rows
NumberNUMBERstringmin, max, step, placeholder
HiddenHIDDENstringdefault (only param that matters)

Selection Controls

ControlConstantReturnsKey Params
SelectSELECTstringoptions (key=>label array), groups
Select2SELECT2`string\array`options, multiple (bool), select2options
ChooseCHOOSEstringoptions (key=>[title,icon]), toggle (bool)
Visual ChoiceVISUAL_CHOICEstringoptions (key=>[title,image])
SwitcherSWITCHERstringlabel_on, label_off, return_value (default 'yes')

Unit / Dimension Controls

ControlConstantReturnsKey Params
SliderSLIDER['size'=>int, 'unit'=>string]size_units, range (per unit: min/max/step)
DimensionsDIMENSIONS['top','right','bottom','left','unit','isLinked']size_units, range, allowed_dimensions
Image DimensionsIMAGE_DIMENSIONS['width'=>int, 'height'=>int]default

Media / Asset Controls

ControlConstantReturnsKey Params
ColorCOLORstring (hex/rgba)alpha (bool, default true)
MediaMEDIA['id'=>int, 'url'=>string]media_types (default ['image'])
GalleryGALLERYarray of ['id','url']default
IconsICONS['value'=>string, 'library'=>string]default, fa4compatibility, recommended, skin
IconICONstringDEPRECATED - use ICONS instead
FontFONTstringdefault
URLURL['url','is_external','nofollow','custom_attributes']placeholder, autocomplete, options
Date TimeDATE_TIMEstringpicker_options (Flatpickr config)

REPEATER

Returns: array of rows, each row is an assoc array of field values. Use title_field for dynamic row labels.

Render: PHP: $settings['list'] is array of rows. Each row has _id key. Use class elementor-repeater-item-{$item['_id']} for per-item styling with {{CURRENT_ITEM}}. JS template: _.each(settings.list, function(item) {... item._id...})

POPOVER_TOGGLE

Used with start_popover() / end_popover() to group controls in a popup.

3. UI Controls

UI controls display information in the panel but store no data.

ControlConstantKey ParamsPurpose
HeadingHEADINGlabelSection heading text
DividerDIVIDER-Horizontal separator line
AlertALERTalert_type (info\success\warning\danger), contentColored alert box
NoticeNOTICEnotice_type, content, dismissible (bool), headingDismissible notice
Raw HTMLRAW_HTMLraw, content_classesArbitrary HTML in panel
ButtonBUTTONtext, button_type (default\success), eventClickable button
Deprecated NoticeDEPRECATED_NOTICEwidget, since, last, plugin, replacementDeprecation warning
// HEADING
$this->add_control('heading_style', [
    'label' => esc_html__('Title Style', 'textdomain'),
    'type' => \Elementor\Controls_Manager::HEADING,
    'separator' => 'before',
]);

// DIVIDER
$this->add_control('hr', [
    'type' => \Elementor\Controls_Manager::DIVIDER,
]);

4. Group Controls

Group controls bundle multiple related controls. Use add_group_control() with selector (singular, string) for CSS targeting.

Full PHP code examples for group controls, fields_options, custom controls, and global styles: see resources/group-custom-controls.md
Group ControlClassType GetterKey Params
TypographyGroup_Control_Typography::get_type()selector, fields_options, global
BackgroundGroup_Control_Background::get_type()selector, types (classic\gradient\video\slideshow)
BorderGroup_Control_Border::get_type()selector, fields_options
Box ShadowGroup_Control_Box_Shadow::get_type()selector, exclude
Text ShadowGroup_Control_Text_Shadow::get_type()selector, exclude
Text StrokeGroup_Control_Text_Stroke::get_type()selector, exclude
CSS FilterGroup_Control_Css_Filter::get_type()selector, exclude
Image SizeGroup_Control_Image_Size::get_type()include, exclude, default

Common group control params: name (required, unique prefix), selector, exclude (array of inner control names), fields_options (override inner control settings).

5. Structural Controls

Sections

Every control must be inside a section. Sections appear as collapsible panels.

$this->start_controls_section('section_id', [
    'label' => esc_html__('Section Name', 'textdomain'),
    'tab' => \Elementor\Controls_Manager::TAB_CONTENT,  // default
    'condition' => [],  // optional
]);
// ... controls ...
$this->end_controls_section();

Tabs (within a section)

Group controls into switchable tabs (e.g., Normal / Hover).

$this->start_controls_tabs('style_tabs');

$this->start_controls_tab('normal_tab', [
    'label' => esc_html__('Normal', 'textdomain'),
]);
// ... normal state controls ...
$this->end_controls_tab();

$this->start_controls_tab('hover_tab', [
    'label' => esc_html__('Hover', 'textdomain'),
]);
// ... hover state controls ...
$this->end_controls_tab();

$this->end_controls_tabs();

Popovers

Group controls in a popup that appears on toggle.

$this->add_control('popover_toggle', [
    'type' => \Elementor\Controls_Manager::POPOVER_TOGGLE,
    'label' => esc_html__('Options', 'textdomain'),
    'label_off' => esc_html__('Default', 'textdomain'),
    'label_on' => esc_html__('Custom', 'textdomain'),
    'return_value' => 'yes',
]);
$this->start_popover();
// ... controls ...
$this->end_popover();

6. CSS Selectors

The {{WRAPPER}} Pattern

All selectors should use {{WRAPPER}} for scoped styling. Resolves to .elementor-{page_id}.elementor-element.elementor-element-{widget_id}.

Value Placeholders by Control Type

Control TypeSelector Pattern
String controls (TEXT, SELECT, COLOR, etc.)'{{WRAPPER}}.el' => 'property: {{VALUE}};'
SLIDER'{{WRAPPER}}.el' => 'width: {{SIZE}}{{UNIT}};'
DIMENSIONS'{{WRAPPER}}.el' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
URL / MEDIA'{{WRAPPER}}.el' => 'background-image: url({{URL}});'

Multiple Properties in One Selector

'selectors' => [
    '{{WRAPPER}} .el' => 'color: {{VALUE}}; border-color: {{VALUE}}; outline-color: {{VALUE}};',
],

Multiple / Comma-Separated Selectors

'selectors' => [
    '{{WRAPPER}} .heading, {{WRAPPER}} .content' => 'color: {{VALUE}};',
],
// OR as separate keys:
'selectors' => [
    '{{WRAPPER}} .heading' => 'color: {{VALUE}};',
    '{{WRAPPER}} .content' => 'color: {{VALUE}};',
],

RTL/LTR Support

'selectors' => [
    'body:not(.rtl) {{WRAPPER}} .el' => 'padding-left: {{VALUE}};',
    'body.rtl {{WRAPPER}} .el' => 'padding-right: {{VALUE}};',
],

Hover States

// Via group control:
'selector' => '{{WRAPPER}}:hover .el',
// Via tabs: put controls in a "Hover" tab

Cross-Control Values

Reference another control's value by prefixing with the control name:

$this->add_control('aspect_width', [
    'type' => \Elementor\Controls_Manager::NUMBER,
]);
$this->add_control('aspect_height', [
    'type' => \Elementor\Controls_Manager::NUMBER,
    'selectors' => [
        '{{WRAPPER}} img' => 'aspect-ratio: {{aspect_width.VALUE}} / {{aspect_height.VALUE}};',
    ],
]);

Selectors Dictionary

Transform old stored values to new CSS values (backward compat). Only works with string-returning controls.

$this->add_control('align', [
    'type' => \Elementor\Controls_Manager::CHOOSE,
    'selectors_dictionary' => [
        'left' => is_rtl() ? 'end' : 'start',
        'right' => is_rtl() ? 'start' : 'end',
    ],
    'selectors' => [
        '{{WRAPPER}} .el' => 'text-align: {{VALUE}};',
    ],
]);

Element ID

{{ID}} resolves to the element's unique ID. Discouraged -- prefer {{WRAPPER}}.

7. Responsive Controls

Use add_responsive_control() instead of add_control(). Automatically creates per-device controls.

$this->add_responsive_control('spacing', [
    'label' => esc_html__('Spacing', 'textdomain'),
    'type' => \Elementor\Controls_Manager::SLIDER,
    'range' => ['px' => ['min' => 0, 'max' => 100]],
    'devices' => ['desktop', 'tablet', 'mobile'],    // optional, default all 3
    'default' => ['size' => 30, 'unit' => 'px'],
    'tablet_default' => ['size' => 20, 'unit' => 'px'],
    'mobile_default' => ['size' => 10, 'unit' => 'px'],
    'selectors' => [
        '{{WRAPPER}} .el' => 'margin-bottom: {{SIZE}}{{UNIT}};',
    ],
]);

The devices parameter limits which breakpoints appear. Per-device defaults use tablet_default and mobile_default keys. Group controls automatically support responsive for their inner controls.

8. Conditional Display

Basic condition Parameter

// Show only when 'border' switcher is 'yes'
'condition' => ['border' => 'yes'],

// Show when value is one of multiple options (OR)
'condition' => ['type' => ['option1', 'option2']],

// Multiple conditions (AND)
'condition' => [
    'border' => 'yes',
    'border_style!' => '',   // ! suffix = not equal
],

Advanced conditions Parameter

Supports operators: ==, !=, !==, ===, in, !in, contains, !contains, <, <=, >, >=

'conditions' => [
    'relation' => 'or',  // 'and' (default) or 'or'
    'terms' => [
        ['name' => 'type', 'operator' => '===', 'value' => 'video'],
        ['name' => 'type', 'operator' => '===', 'value' => 'slideshow'],
    ],
],

Conditions can be nested. Repeater inner fields can only depend on other inner fields, NOT outer controls.

9. Dynamic Content

Enable dynamic tags (Elementor Pro) on any data control:

$this->add_control('heading', [
    'label' => esc_html__('Heading', 'textdomain'),
    'type' => \Elementor\Controls_Manager::TEXT,
    'dynamic' => ['active' => true],
]);

Works with: TEXT, TEXTAREA, NUMBER, URL, MEDIA, WYSIWYG, and most data controls.

Frontend Available

$this->add_control('slides_count', [
    'type' => \Elementor\Controls_Manager::NUMBER,
    'default' => 3,
    'frontend_available' => true,  // default: false
]);

Access in JS handler: this.getElementSettings('slides_count')

10. Global Styles

Use the global parameter to inherit from the site's design system (set in Site Settings).

Global Colors Constants

  • \Elementor\Core\Kits\Documents\Tabs\Global_Colors::COLOR_PRIMARY
  • \Elementor\Core\Kits\Documents\Tabs\Global_Colors::COLOR_SECONDARY
  • \Elementor\Core\Kits\Documents\Tabs\Global_Colors::COLOR_TEXT
  • \Elementor\Core\Kits\Documents\Tabs\Global_Colors::COLOR_ACCENT

Global Typography Constants

  • \Elementor\Core\Kits\Documents\Tabs\Global_Typography::TYPOGRAPHY_PRIMARY
  • \Elementor\Core\Kits\Documents\Tabs\Global_Typography::TYPOGRAPHY_SECONDARY
  • \Elementor\Core\Kits\Documents\Tabs\Global_Typography::TYPOGRAPHY_TEXT
  • \Elementor\Core\Kits\Documents\Tabs\Global_Typography::TYPOGRAPHY_ACCENT

Controls with global show a globe icon for users to pick a global style or set custom.

12. Common Mistakes

MistakeCorrect Approach
Using add_control() outside a sectionAlways wrap in start_controls_section() / end_controls_section()
Using selector (singular) on non-group controlsNon-group controls use selectors (plural, array). Group controls use selector (singular, string).
Forgetting {{WRAPPER}} in selectorsAlways prefix selectors with {{WRAPPER}} for scoped styles
Using {{VALUE}} with SLIDER controlSLIDER returns array; use {{SIZE}}{{UNIT}}
Using {{VALUE}} with DIMENSIONS controlUse {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}
Using {{VALUE}} with URL/MEDIA controlUse {{URL}} for the URL component
Nesting start_controls_section inside anotherSections cannot be nested. End one before starting another.
Putting tabs outside a sectionstart_controls_tabs() must be inside a section
Repeater inner field depending on outer controlConditional display across repeater levels is not supported
Using selectors_dictionary with array-returning controlsOnly works with string-value controls (TEXT, SELECT, CHOOSE, etc.)
Not using esc_html__() for labelsAlways internationalize user-facing strings
Setting SWITCHER default to true or 1SWITCHER returns a string; default should be 'yes' or ''
Using innerHTML = on frontendUse Elementor's rendering patterns; may be blocked by CSP
Setting REPEATER prevent_empty wrongDefaults to true; set false if all rows should be deletable

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.65%
按下载量换算47

Claude

29.05%
按下载量换算39

Cursor

16.79%
按下载量换算22

Gemini CLI

8.63%
按下载量换算11

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills