@qentrah/templates
v3.0.0-beta.31
Published
Template compatibility package for Qentrah CMS
Readme
@qentrah/templates
Template compatibility package for Qentrah CMS
These guides describe the published 3.0.0-beta.29 package. The examples use the APIs and files in that release; beta packages should be kept on matching versions.
Documentation
Install and verify
Before you start
The package does not declare an engine requirement. Use a maintained Node.js release appropriate to your host application.
Use a project with a package.json. Check the runtime and package manager:
node --version
npm --versionInstall the documented version
npm install @qentrah/[email protected]Confirm the installation
npm ls @qentrah/templatesThe output should show @qentrah/[email protected]. Commit the lockfile so another developer installs the same dependency tree.
Peer dependencies
Install compatible peers in the consuming application. These ranges come from the published manifest.
| Package | Required range |
| --- | --- |
| hono | ^4.10.4 |
| @qentrah/cms | ^3.0.0-beta.29 |
Check a real export
import { renderDocsLayout } from "@qentrah/templates";
const html = renderDocsLayout({
title: "Project guide",
content: "<p>Welcome to your guide.</p>",
currentPath: "/guide",
navigation: [{ title: "Guide", path: "/guide" }],
});The function returns an HTML string. Your server chooses how to send that string as an HTML response.
Render pages and forms
Compose a documentation layout
import { renderDocsLayout, renderForm } from "@qentrah/templates";
const form = renderForm({
action: "/articles",
method: "POST",
fields: [{ name: "title", label: "Title", type: "text", required: true }],
submitButtons: [{ label: "Save", type: "submit" }],
});
const html = renderDocsLayout({
title: "New article",
content: form,
currentPath: "/articles/new",
navigation: [{ title: "Articles", path: "/articles" }],
});Both functions return strings. The form action must point to a route implemented by your server. Rendering a form does not save a record.
Form data contract
fields and submitButtons are required. Optional form settings include id, action, method, hxPost, hxPut, hxTarget, title, description, and className. Field types include text, email, textarea, select, checkbox, rich_text, number, date, multi_select and file.
Input handling
The templates interpolate HTML. Validate and sanitize untrusted values in your application. Server handlers must perform their own authentication, authorization and input validation. Never treat a rendered interface as a security boundary.
Existing template families
The root also exposes cache, database-table, content-edit, content-new, checkbox, FAQ, API-reference, field-types and content-list renderers. Inspect each declaration’s data type before calling it; the renderers do not share one universal parameter object.
API and exports
Package identity
| Field | Value |
| --- | --- |
| Package | @qentrah/templates |
| Version inspected | 3.0.0-beta.29 |
| License | Not declared in the published manifest |
| Module type | module |
Public import paths
| Import path | Published target |
| --- | --- |
| @qentrah/templates | ./dist/index.d.ts |
| @qentrah/templates/pages/* | ./dist/pages/*.d.ts |
| @qentrah/templates/layouts/* | ./dist/layouts/*.d.ts |
| @qentrah/templates/components/* | ./dist/components/*.d.ts |
Root functions
renderDocsLayout, renderForm, renderFormField, renderFilterBar, renderCacheDashboard, renderDatabaseTablePage, renderContentEditPage, renderContentNewPage, renderCheckboxPage, renderFAQList, renderFAQForm, renderAPIReferencePage, getFieldTypeDefinitions, renderFieldTypesPage, renderContentListTemplate, and renderGlassAdminTemplate are exported from the root.
Use root imports for portability. The old README’s layouts/admin-layout-v2 and pages/admin-cache examples do not match the shipped files. The actual page files include the .template suffix.
Inspect the original release
Open the versioned npm page or download its published archive. The archive includes the actual executable files and declarations used to write these guides.
Troubleshooting
Check the installed version
npm ls @qentrah/templatesCompare the installed version with the version noted in this guide. Inspect your lockfile before changing dependencies; prerelease behavior may differ between versions.
Import or module errors
Use only public import paths listed in API and exports. Avoid importing guessed paths inside dist. ESM-only packages require an ESM-aware application. Install declared peer dependencies in the consuming application.
Rendered HTML versus components
The renderers return strings, not React elements. Supply all required data properties and send the output as HTML from a server route. Some legacy templates reference external CSS or scripts and retain older branding; inspect the rendered output before adopting a template.
Content handling
The renderer interpolates HTML strings. Treat content and other template inputs as trusted server-owned content or sanitize untrusted values in your application before rendering. Rendering a string does not authenticate a user or authorize an action.
Release documentation
Documentation checked against the previously published package artifact. This documentation-only release preserves executable files and dependencies.
