webiny-page-settings-extensions
Skill này làm gì
Skill này hướng dẫn AI của bạn khi thêm tab hoặc trường cài đặt vào cài đặt trang trong Website Builder của Webiny. Dành cho lập trình viên tùy chỉnh một website Webiny.
Khi nào nên dùng
- ✓Khi bạn muốn một tab mới trong ngăn cài đặt trang, như Xuất bản hoặc Phân tích.
- ✓Khi bạn cần thêm trường vào một nhóm cài đặt trang hiện có, như SEO.
- ✓Khi bạn cần lưu cài đặt trang tùy chỉnh mà không đụng đến thuộc tính có sẵn.
Liên kết skill
https://github.com/webiny/webiny-js/blob/next/skills/user-skills/admin/website-builder/page-settings/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Thêm tab Phân tích vào cài đặt trang của Website Builder, nơi biên tập viên có thể nhập mã theo dõi.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill cho thấy cách tạo một class nhóm cài đặt cho tab mới hoặc một modifier cho tab hiện có, đăng ký nó như một tính năng, và lưu dữ liệu dưới khu vực extensions của trang.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Page Settings Extensions
TL;DR
Page settings extensions let you add new tabs to the page settings drawer or inject fields into existing tabs. Create a class implementing PageSettingsGroup.Interface for a new tab, or PageSettingsGroupModifier.Interface to extend an existing one. Register both via createFeature() and <RegisterFeature>. Always store custom data in doc.extensions — never write to doc.properties, which is reserved for built-in system properties.
YOU MUST include the full file path with the .tsx extension in every src prop. For example, use src={"/extensions/myPageSettings/index.tsx"}, NOT src={"/extensions/myPageSettings/index"}. Omitting the file extension will cause a build failure.
For field types, renderers, layout, validation, and all other form builder APIs, refer to the webiny-form-model skill.
Important: Where to Store Data
Use
doc.extensionsfor all custom data. Thedoc.propertiesobject holds built-in system properties (title, path, snippet, image, tags, seo, social). Writing custom fields intodoc.propertiesrisks naming collisions with future Webiny updates and can corrupt system behavior. Always namespace your data underdoc.extensions.<yourGroupName>.
// CORRECT — custom data in doc.extensions
mapFromForm(formData, doc) {
doc.extensions.mySettings = doc.extensions.mySettings ?? {};
doc.extensions.mySettings.myField = formData.myField;
}
// WRONG — never write custom data into doc.properties
mapFromForm(formData, doc) {
doc.properties.myField = formData.myField; // DON'T DO THIS
}
Adding a New Settings Group
A new settings group appears as its own tab in the page settings drawer. Implement PageSettingsGroup.Interface with these members:
| Member | Type | Description |
|---|---|---|
name |
string |
Unique group identifier (used as form field namespace) |
label |
string |
Tab label shown in the UI |
description |
string (optional) |
Description shown below the tab label |
icon |
{ type: "icon", name: string } (optional) |
FontAwesome icon for the tab (e.g., "fas/calendar-alt") |
buildForm(form) |
method | Define fields and layout |
mapToForm(doc) |
method | Read from document to populate the form |
mapFromForm(formData, doc) |
method | Write form values back to the document |
Complete Example: Publishing Settings Group
// extensions/myPageSettings/PublishingSettingsGroup.ts
import { PageSettingsGroup } from "webiny/admin/website-builder/page/editor";
class PublishingSettingsGroupImpl implements PageSettingsGroup.Interface {
name = "publishing";
label = "Publishing";
description = "Configure publishing schedule and visibility.";
icon = { type: "icon", name: "fas/calendar-alt" };
buildForm(form: PageSettingsGroup.FormBuilder): void {
form.fields(fields => ({
publishDate: fields.datetime().withTimezone().label("Publish date"),
unpublishDate: fields.datetime().dateOnly().label("Unpublish date"),
visibility: fields
.text()
.label("Visibility")
.options([
{ label: "Public", value: "public" },
{ label: "Private", value: "private" },
{ label: "Password Protected", value: "password" }
])
.defaultValue("public"),
featured: fields.boolean().label("Featured page")
}));
form.layout(layout => [
layout.row("publishDate"),
layout.row("unpublishDate"),
layout.row("visibility"),
layout.row("featured")
]);
}
mapToForm(doc: PageSettingsGroup.PageDocument): Record<string, any> {
const publishing = doc.extensions?.publishing;
return {
publishDate: publishing?.publishDate ?? null,
unpublishDate: publishing?.unpublishDate ?? null,
visib
Câu hỏi thường gặp
Dữ liệu trang tùy chỉnh nên được lưu ở đâu?
Dưới khu vực extensions của trang với tên bạn chọn, không bao giờ trong các thuộc tính có sẵn.
Nó có giải thích mọi loại trường form không?
Không. Nó tham chiếu skill model form cho các loại trường, trình render và kiểm tra hợp lệ.
Đường dẫn nguồn phải có gì?
Đường dẫn file đầy đủ với đuôi .tsx, nếu không bản build sẽ lỗi.
Chi tiết
Mô tả gốc của tác giả
Extending the Website Builder page settings with custom settings groups and modifiers. Use this skill when the developer wants to add a new tab/group to the page settings drawer (e.g., Publishing, Analytics, Access Control), or modify an existing settings group (e.g., add fields to General or SEO). Covers PageSettingsGroup, PageSettingsGroupModifier, and the doc.extensions data model. For field types, renderers, and layout details, see the webiny-form-model skill.
repo: webiny/webiny-js
Độ phổ biến
- Sao GitHub
- 8.1k
- Vị trí xếp hạng
- #12579
- Giấy phép
- —
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
prd-to-plan
8.1kGiúp agent của bạn biến tài liệu yêu cầu sản phẩm thành kế hoạch theo giai đoạn gồm các lát cắt đầu-cuối nhỏ, lưu thành file Markdown.
webiny-admin-architect
8.1kDạy agent của bạn cách xây dựng màn hình quản trị cho nền tảng Webiny, dùng các tầng logic nghiệp vụ và mẫu presenter.
webiny-admin-permissions
8.1kDạy agent của bạn thêm kiểm soát quyền vào màn hình quản trị Webiny, gồm form quyền tự sinh và kiểm tra ẩn hoặc hiện.
webiny-form-model
8.1kDạy agent của bạn xây dựng form trong Webiny bằng trình tạo trường khai báo, bố cục, kiểm tra hợp lệ và quy tắc có điều kiện.
Skill tương tự
angular-developer
280kGiúp agent của bạn viết code Angular và tư vấn cấu trúc dự án, hữu ích khi bắt đầu dự án mới hoặc cải thiện hiệu suất.
frontend-a11y
280kGiúp agent của bạn làm cho giao diện web dễ tiếp cận với mọi người. Đảm bảo website và ứng dụng hoạt động tốt với trình đọc màn hình và điều hướng bằng bàn phím.
frontend-patterns
280kGiúp agent của bạn áp dụng các mẫu hiện đại trong phát triển frontend. Tối ưu hiệu năng, quản lý trạng thái và tuân theo thực hành tốt nhất với React và Next.js.