File Management
browFiles
Browses and lists files and folders in a directory.path(string): Directory path relative to media root
files(array): Array of file objectsname(string): File nameurl(string): Public URL to access file
folders(array): Array of folder names
uploadFile
Uploads one or more files to a specified destination.files(Express.Multer.File[]): Array of file objects from multerdestinationPath(string): Destination directory path
name(string): File nameurl(string): Public URL to access filemimetype(string): MIME typesize(number): File size in bytes
- Creates destination folder if it doesn’t exist
- Writes files asynchronously
- Generates public URLs for each file
- Supports any file type
createFolder
Creates a new folder in the media directory.path(string): Folder path to create
- Creates parent directories if they don’t exist
- No error if folder already exists
deleteFile
Deletes a file from the media directory.path(string): File path to delete
Page Management
createPage
Creates a new CMS page.data(object): Page dataname(string, required): Page nameurl_key(string, required): URL-friendly identifierstatus(number, required): Page status (0=disabled, 1=enabled)content(string, required): Page HTML contentmeta_title(string, required): SEO meta titlemeta_description(string): SEO meta descriptionmeta_keywords(string): SEO meta keywordslayout(string): Page layout template
context(object): Context object for hooks
- All required fields must be provided
- URL key must be unique
- Content must be valid HTML
updatePage
Updates an existing CMS page.uuid(string): Page UUIDdata(object): Page data to updatecontext(object): Context object for hooks
deletePage
Deletes a CMS page.uuid(string): Page UUIDcontext(object): Context object for hooks
Widget Management
Widgets are reusable content blocks that can be placed in various locations.createWidget
Creates a new widget.data(object): Widget dataname(string, required): Widget namestatus(number, required): Widget status (0=disabled, 1=enabled)sort_order(number, required): Display ordertype(string): Widget type identifiersettings(object): Widget-specific settingsarea(string): Display area/location
context(object): Context object for hooks
banner: Image banner with optional linktext: HTML text contentmenu: Navigation menuproduct_list: Product listingnewsletter: Newsletter signup form
updateWidget
Updates an existing widget.uuid(string): Widget UUIDdata(object): Widget data to updatecontext(object): Context object for hooks
deleteWidget
Deletes a widget.uuid(string): Widget UUIDcontext(object): Context object for hooks
loadWidgetInstances
Loads all active widget instances for a specific area.area(string): Widget area name
sort_order
Example - Render Widgets: