404
-Страница не найдена
- На главную +{{ 'staticPages.notFound' | translate }}
+ {{ 'staticPages.backHome' | translate }}diff --git a/docs/Content-Management.md b/docs/Content-Management.md new file mode 100644 index 0000000..61d2c58 --- /dev/null +++ b/docs/Content-Management.md @@ -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": "
Company story
" + } + }, + "seo": { + "title": { "en": "About Us" }, + "description": { "en": "About our marketplace" }, + "canonical": "/about" + } + } + } +} +``` diff --git a/docs/platform/11-navigation-system.md b/docs/platform/11-navigation-system.md index 92e116a..652bafd 100644 --- a/docs/platform/11-navigation-system.md +++ b/docs/platform/11-navigation-system.md @@ -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. Система навигации ## Назначение diff --git a/docs/platform/12-static-pages-system.md b/docs/platform/12-static-pages-system.md index b2ad65e..645f43b 100644 --- a/docs/platform/12-static-pages-system.md +++ b/docs/platform/12-static-pages-system.md @@ -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. Система статических страниц ## Назначение diff --git a/src/app/components/footer/footer.component.html b/src/app/components/footer/footer.component.html index dd7e89b..7bb2300 100644 --- a/src/app/components/footer/footer.component.html +++ b/src/app/components/footer/footer.component.html @@ -14,7 +14,11 @@{{ 'staticPages.duplicateSlug' | translate }}
+ } + @if (validation().emptyTitles.length > 0) { +{{ 'staticPages.emptyTitle' | translate }}
+ } + +Страница не найдена
- На главную +{{ 'staticPages.notFound' | translate }}
+ {{ 'staticPages.backHome' | translate }}