feat(cms): add static pages module
This commit is contained in:
154
docs/Content-Management.md
Normal file
154
docs/Content-Management.md
Normal file
@@ -0,0 +1,154 @@
|
||||
# Static Pages / CMS - Sprint 14
|
||||
|
||||
## Scope
|
||||
|
||||
Sprint 14 adds configuration-driven CMS support for unlimited marketplace static pages.
|
||||
|
||||
Out of scope:
|
||||
- backend save endpoints
|
||||
- marketplace-specific content logic
|
||||
- hardcoded page names
|
||||
|
||||
## Feature Architecture
|
||||
|
||||
```text
|
||||
src/app/features/content-management/
|
||||
facade/
|
||||
services/
|
||||
models/
|
||||
pages/
|
||||
components/
|
||||
```
|
||||
|
||||
Main pieces:
|
||||
- `ContentPageService` normalizes bootstrap static page data
|
||||
- `ContentManagementFacade` exposes normalized pages and validation helpers
|
||||
- `StaticPagesEditorComponent` integrates CMS editing into Project Editor
|
||||
|
||||
## Bootstrap Structure
|
||||
|
||||
Static pages live under `bootstrap.staticPages`.
|
||||
|
||||
Supported properties per page:
|
||||
- `id`
|
||||
- `slug`
|
||||
- `title`
|
||||
- `showInFooter`
|
||||
- `showInHeader`
|
||||
- `showInSitemap`
|
||||
- `icon`
|
||||
- `order`
|
||||
- `visibility`
|
||||
- `requiresAuthentication`
|
||||
- `footerGroup`
|
||||
- `translations`
|
||||
- `html`
|
||||
- `seo`
|
||||
|
||||
## Translation Model
|
||||
|
||||
Content can be stored in `translations[locale]`:
|
||||
- `title`
|
||||
- `html`
|
||||
- `seo`
|
||||
|
||||
Legacy structures remain supported through normalization.
|
||||
|
||||
## Dynamic Routing
|
||||
|
||||
Frontend uses dynamic static page resolution instead of manual page registration.
|
||||
|
||||
Current route surface:
|
||||
- `/:lang/:staticPath`
|
||||
- legacy compatibility: `/:lang/page/:key`
|
||||
|
||||
Resolver maps route slug to bootstrap-configured page.
|
||||
|
||||
## Header Generation
|
||||
|
||||
Pages with `showInHeader: true` render in header navigation.
|
||||
|
||||
No hardcoded page list required.
|
||||
|
||||
## Footer Generation
|
||||
|
||||
Footer can render grouped static pages from bootstrap flags and metadata.
|
||||
|
||||
Supported grouping:
|
||||
- Company
|
||||
n- Customer
|
||||
- Legal
|
||||
- Support
|
||||
- Social
|
||||
|
||||
Social links come from footer bootstrap config.
|
||||
|
||||
## Rendering
|
||||
|
||||
`StaticPageComponent` now:
|
||||
- resolves content by slug or id
|
||||
- reloads content when language changes
|
||||
- updates document title/meta
|
||||
- supports RTL-ready `dir` switching
|
||||
- renders backend HTML safely through sanitization
|
||||
|
||||
## Editor Integration
|
||||
|
||||
Project Editor now includes `Static Pages` section.
|
||||
|
||||
Supported actions:
|
||||
- create page
|
||||
- delete page
|
||||
- enable footer/header/sitemap visibility
|
||||
- edit slug
|
||||
- edit icon
|
||||
- edit order
|
||||
- edit translations
|
||||
- edit HTML
|
||||
|
||||
## Validation
|
||||
|
||||
Current validation prevents:
|
||||
- duplicate slugs
|
||||
- empty titles
|
||||
|
||||
## Future Backend Endpoints
|
||||
|
||||
Recommended future endpoints:
|
||||
- `GET /builder/content-pages`
|
||||
- `PUT /builder/content-pages`
|
||||
- `POST /builder/content-pages/import`
|
||||
- `GET /builder/content-pages/export`
|
||||
- `POST /builder/content-pages/validate`
|
||||
|
||||
## Example Bootstrap
|
||||
|
||||
```json
|
||||
{
|
||||
"staticPages": {
|
||||
"about": {
|
||||
"id": "about",
|
||||
"slug": "about",
|
||||
"title": { "en": "About Us", "ru": "О нас" },
|
||||
"showInFooter": true,
|
||||
"showInHeader": true,
|
||||
"showInSitemap": true,
|
||||
"icon": "info",
|
||||
"order": 1,
|
||||
"requiresAuthentication": false,
|
||||
"footerGroup": "Company",
|
||||
"translations": {
|
||||
"en": {
|
||||
"title": "About Us",
|
||||
"html": "<h2>About</h2><p>Company story</p>"
|
||||
}
|
||||
},
|
||||
"seo": {
|
||||
"title": { "en": "About Us" },
|
||||
"description": { "en": "About our marketplace" },
|
||||
"canonical": "/about"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -1,3 +1,8 @@
|
||||
## CMS Navigation Integration
|
||||
- Static pages with `showInHeader: true` may appear in header navigation automatically.
|
||||
- Static pages with `showInFooter: true` may be grouped into footer sections using `footerGroup`.
|
||||
- Social links remain footer-config driven and can coexist with CMS page groups.
|
||||
- Navigation stays configuration-driven; no marketplace-specific page names are hardcoded in frontend.
|
||||
# 11. Система навигации
|
||||
|
||||
## Назначение
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
## CMS Upgrade
|
||||
- Static pages now support unlimited bootstrap-driven entries under `staticPages`.
|
||||
- Each page may define slug, visibility, header/footer/sitemap flags, icon, order, translations, HTML and SEO metadata.
|
||||
- Frontend resolves pages dynamically from bootstrap instead of hardcoded page names.
|
||||
- Header and footer may consume the same static page registry without duplicating page definitions.
|
||||
# 12. Система статических страниц
|
||||
|
||||
## Назначение
|
||||
|
||||
Reference in New Issue
Block a user