skill-doli-website-edit
Skill này làm gì
Skill này giải thích cách thay đổi một website Dolibarr được lưu trong cơ sở dữ liệu, như nội dung của một trang hoặc một mẫu. Skill dành cho người vận hành website Dolibarr cần một chỉnh sửa cụ thể.
Khi nào nên dùng
- ✓Khi bạn cần thay đổi văn bản hoặc HTML của một trang trên website Dolibarr.
- ✓Khi bạn cần tìm đúng site và trang trong cơ sở dữ liệu Dolibarr trước khi chỉnh sửa.
- ✓Khi bạn muốn thay đổi tối thiểu một mẫu hoặc trang website, không phải thiết kế lại.
Liên kết skill
https://github.com/Dolibarr/dolibarr/blob/develop/.agents/skills/skill-doli-website-edit/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
“Thay đổi nội dung trang liên hệ trên website Dolibarr của tôi, và giữ nguyên bố cục còn lại như hiện tại.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill chỉ cách tìm site và trang trong cơ sở dữ liệu, rồi chỉnh sửa nội dung trang đã lưu với thay đổi tối thiểu, giữ nguyên cấu trúc HTML và các lớp CSS hiện có.
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.
Skill: Handle Dolibarr website edit
A Dolibarr website (module Website) is loaded into the database. It is NOT a set of static files: the source of truth is the database, and the files under documents/website/ are only generated artifacts.
Where the data lives
llx_website: the websites. Relevant columns:rowid,ref(site name, used as directory name),lang,fk_default_home,otherjs,othercss.llx_website_page: the pages of each website. Relevant columns:rowid,fk_website,pageurl,title,lang,type_container,content(the HTML of the page),htmlheader(the<head>part).
To find the site and the page to edit:
SELECT rowid, ref FROM llx_website WHERE ref = 'mywebsite';
SELECT rowid, pageurl, title FROM llx_website_page WHERE fk_website = <siteid>;
Editing a page
Storage of page content
- Identify the website and the page (see queries above).
- To change the content of a page, edit the HTML stored in the
contentcolumn ofllx_website_page:
UPDATE llx_website_page SET content = '...new html...' WHERE rowid = <pageid>;
- The content is the HTML of the page body. Keep the existing HTML structure (containers, CSS classes) — do not redesign or reformat the whole page, apply the minimal change asked for.
Page format
- The
type_containercolumn can bepage(common page),bannerif this is just a part of a page included into a main page,blogpostif the page is a news article (fulle page or included into another page), orlibraryif page contains only PHP functions, orsetupfor a page never shown to visitor but used to offer a form to setup the website, orother(usually a part of page included into a mainpagetype page) - The content of each page must be organized using
<section conteneditable="true" id="a unique id">tags to separate each independant block of content.
Regenerating the .tpl.php file
The content column alone is not rendered directly. Each page has a generated file:
documents/website/<site-ref>/page<pageid>.tpl.php
<site-ref>is therefof the website (directorydocuments/website/<ref>/).documentsis the Dolibarr documents root ($dolibarr_main_data_rootfromhtdocs/conf/conf.php). With multi-entity enabled, the path isdocuments/<entity>/website/<site-ref>/.- After any change to the
contentcolumn, this file MUST be regenerated, otherwise the change is not visible on the rendered site.
Important: the .tpl.php file is NOT a raw copy of the content column. It is built by dolSavePageContent() (in htdocs/core/lib/website2.lib.php), which wraps the page content with a PHP header, the page htmlheader, the website CSS and other PHP code. So never write the content value raw into the .tpl.php file.
Two ways to regenerate the file:
- Preferred, through Dolibarr code: call
dolSavePageContent($filetpl, $website, $objectpage, 1)with the website object and the page object loaded from database, where$filetpl = $dolibarr_main_data_root.'/website/'.$website->ref.'/page'.$pageid.'.tpl.php'. This is exactly what the website editor does when saving a page. It can also be done by saving the page from the website editor UI (Website menu -> site -> edit page -> Save). - Only if Dolibarr code cannot be executed: archive the old file first (see below), then regenerate the file with the same structure as the previous version, replacing only the part that carries the page content with the new value from the
contentcolumn.
Archiving the previous version
Before rewriting page<pageid>.tpl.php, the existing file MUST be archived as:
documents/website/<site-ref>/page<pageid>.tpl.php.v<TIMESTAMP>
<TIMESTAMP>is the unix timestamp of the moment of archiving (this is the convention ofarchiveOrBackupFile()inhtdocs/core/lib/files.lib.php, which moves — not copies — the old file and keeps the last 5 versions only).- Never overwrite or delete the old .tpl.php without creating this
.v<TIMESTAMP>version file first.
Verification
After an edit, check that:
- The
contentcolumn ofllx_website_pagecontains the new HTML. documents/website/<site-ref>/page<pageid>.tpl.phphas been rewritten (check its modification time).- The previous version exists as
page<pageid>.tpl.php.v<TIMESTAMP>.
If the site is served through the alias/container mode, also check that the alias file documents/website/<site-ref>/<pageurl>.php stil
Câu hỏi thường gặp
Các file website được lưu ở đâu?
Website nằm trong cơ sở dữ liệu. Các file trong thư mục tài liệu website là bản sao được tạo ra, nên cơ sở dữ liệu là nguồn chuẩn.
Nó có dựng lại toàn bộ trang không?
Không. Nó chỉ áp dụng thay đổi tối thiểu bạn yêu cầu và giữ nguyên cấu trúc hiện có.
Nó có cần truy cập cơ sở dữ liệu không?
Có. Chỉnh sửa được thực hiện bằng SQL trên các bảng website, nên bạn cần quyền truy cập cơ sở dữ liệu.
Chi tiết
Mô tả gốc của tác giả
Handles instructions to edit a Dolibarr website loaded into the database. Use when the user tries to modify a website, a website template or the content of a website page.
repo: Dolibarr/dolibarr
Độ phổ biến
- Sao GitHub
- 7.8k
- Vị trí xếp hạng
- #12827
- Giấy phép
- GPL-3.0
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
Skill tương tự
api-connector-builder
280kGiúp agent của bạn xây dựng kết nối API mới theo đúng mẫu đã có, dùng khi bạn cần thêm một tích hợp mà không tạo cách làm mới.
api-design
280kGiúp agent của bạn thiết kế REST API theo các thực hành tốt nhất, hữu ích để định nghĩa cách API giao tiếp, hiển thị lỗi và tổ chức dữ liệu.
backend-patterns
280kGiúp agent của bạn với các mẫu kiến trúc phía máy chủ và tối ưu cơ sở dữ liệu, hữu ích khi xây dựng hoặc rà soát code chạy trên máy chủ.