Skip to main content

CnFilesWidget

Files browser widget (folder navigation, thumbnails, mime filter, sort).

Part of the dashboard widget library (v2). Registered with the dashboard widget registry and consumed by LaunchPad's widget grid. See the widget library overview and docs/architecture/cards-and-widgets.md.

Reference​

Props​

NameTypeRequiredDefaultDescription
contentobject\{\}Persisted content blob configuring the folder + toolbar — see `CnFilesWidgetForm for the full shape (folderPath, fileId, viewMode, allowUpload, allowDelete`, …).
placementobject\{\}Placement entity; its id scopes the host Files endpoint.
isAdminbooleanfalseWhether the dashboard shell is in admin mode.
canEditbooleanfalseWhether the dashboard shell is in edit mode.

Additional props​

PropTypeDefaultDescription
apiBaseString/apps/filesApp base for the host files-widget endpoints ({apiBase}/api/widgets/files/{placementId}/...). Set to point the widget at a consuming app's backend (e.g. /apps/launchpad).

Object-bound mode​

Setting objectId + register + schema together switches the widget from the dashboard placement contract (/api/widgets/files/...) to the object's own Nextcloud folder via the OpenRegister object endpoints. CnWidgetGrid's detail-page context merge supplies all three automatically, so a detail page normally needs none of them by hand. Leaving objectId empty (the default) keeps the dashboard behaviour unchanged.

PropTypeDefaultDescription
objectIdString''The OpenRegister object id this widget attaches files to. Enables object-bound mode when set together with register and schema.
registerString''OpenRegister register slug of the bound object. See objectId.
schemaString|Object''OpenRegister schema of the bound object — a slug string, or the resolved schema object as merged by CnWidgetGrid (the slug is derived internally). See objectId.
objectApiBaseString/apps/openregister/apiApp base for the object-file endpoints used in object-bound mode ({objectApiBase}/objects/{register}/{schema}/{id}/...).