
DINHDANH Creator · Bài EM04 · Easy · 5 method ghép sẵn
Composite tiện ích
tạo nội dung + route · index - đủ cấu trúc
tạo nội dung + route · index - đủ cấu trúc
Dựng trên writeFile + addRoute. Field / findByName: xem EM03.
Ghi chú: Helper ghép sẵn - khi lỗi vẫn kiểm từng bước EM03 / EM05 / EM06.
appifio_createContentWithRoute(title, content, type, options?)Việc: Sinh slug → lưu kho dữ liệu → addRoute → (tuỳ) cập nhật index.
const r = await appifio_client.appifio_createContentWithRoute( 'Bài viết về AI', '
Nội dung...
', 'blog' );
Lưu ý: File handler HTML phải tồn tại (ensureHandlerFile hoặc EM05).
appifio_ensureHandlerFile(filePath, content?)await appifio_client.appifio_ensureHandlerFile('blog/detail.html', htmlDefault);Việc: Chưa có file trang → tạo; đã có → giữ.
appifio_deleteContentWithRoute(slug, type)await appifio_client.appifio_deleteContentWithRoute('bai-viet-ve-ai', 'blog');Việc: Xóa nội dung liên quan + removeRoute + gỡ index.
appifio_updateContentIndex(type, item)await appifio_client.appifio_updateContentIndex('blog', { slug: '…', title: '…' });appifio_removeFromContentIndex(type, slug)await appifio_client.appifio_removeFromContentIndex('blog', 'bai-viet-ve-ai');Checklist EM04 (5/5): createContentWithRoute · ensureHandlerFile · deleteContentWithRoute · updateContentIndex · removeFromContentIndex
EM05 - File trang & upload
Điều hướng nội bộ (cùng ngôn ngữ)
DINHDANH Creator · Loạt Easy Storage · EM04