Files
orion/docs/getting-started/cms-quick-start.md
Samir Boulahtit 3c7af0ccdf refactor: standardize markdown file naming to kebab-case convention
Renamed all documentation files to follow kebab-case naming standard:
- UPPERCASE files → lowercase (e.g., RBAC.md → rbac.md)
- snake_case files → kebab-case (e.g., icons_guide.md → icons-guide.md)
- SCREAMING_SNAKE_CASE → kebab-case (e.g., DATABASE_SETUP_GUIDE.md → database-setup-guide.md)

Files renamed (15 total):
API Documentation:
  - api/RBAC.md → api/rbac.md

Architecture:
  - architecture/API_CONSOLIDATION_PROPOSAL.md → api-consolidation-proposal.md
  - architecture/API_MIGRATION_STATUS.md → api-migration-status.md

Development:
  - development/AUTH_DEPENDENCIES_GUIDE.md → auth-dependencies-guide.md
  - development/CUSTOMER_AUTHENTICATION_IMPLEMENTATION.md → customer-authentication-implementation.md
  - development/CUSTOMER_AUTH_SUMMARY.md → customer-auth-summary.md
  - development/icons_guide.md → icons-guide.md

Database Seeder:
  - database-seeder/DATABASE_INIT_GUIDE.md → database-init-guide.md
  - database-seeder/DATABASE_QUICK_REFERENCE_GUIDE.md → database-quick-reference-guide.md
  - database-seeder/DATABASE_SEEDER_DOCUMENTATION.md → database-seeder-documentation.md
  - database-seeder/MAKEFILE_DATABASE_SEEDER.md → makefile-database-seeder.md

Error Rendering:
  - error-rendering/ERROR_RENDERING_DEVELOPER_DOCUMENTATION.md → error-rendering-developer-documentation.md
  - error-rendering/HTML_ERROR_RENDERING_FLOW_DIAGRAM.md → html-error-rendering-flow-diagram.md

Getting Started:
  - getting-started/DATABASE_QUICK_REFERENCE.md → database-quick-reference.md
  - getting-started/DATABASE_SETUP_GUIDE.md → database-setup-guide.md

Updates:
- Updated all references in mkdocs.yml
- Updated all cross-references in markdown files
- Verified mkdocs builds without warnings or errors

Standard: Use kebab-case (lowercase-with-hyphens) for all markdown files

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 07:58:33 +01:00

4.9 KiB

CMS Quick Start Guide

A quick reference for setting up and using the Content Management System.

What is the CMS?

The CMS allows you to manage static content pages (About, Contact, FAQ, etc.) with:

  • Platform defaults - Base content for all vendors
  • Vendor overrides - Custom content per vendor
  • Automatic fallback - Vendors inherit platform defaults unless overridden

Quick Setup

1. Create Default Content Pages

After running migrations, create the default CMS pages:

make create-cms-defaults

This creates 7 platform default pages:

  • About Us (/about)
  • Contact Us (/contact)
  • FAQ (/faq)
  • Shipping Policy (/shipping)
  • Return & Refund Policy (/returns)
  • Privacy Policy (/privacy)
  • Terms of Service (/terms)

2. Full Database Setup

For a complete setup including CMS:

make db-setup
# Runs: migrations → admin user → CMS pages → demo data

Accessing Pages

All CMS pages are accessible on your shop frontend:

# For domain/subdomain access
https://wizamart.shop/about
https://fashionhub.store/contact

# For path-based access
http://localhost:8000/vendor/wizamart/faq
http://localhost:8000/vendors/fashionhub/shipping

Managing Content

Via Admin Panel

  1. Log in to admin panel: /admin/login
  2. Navigate to Content Pages section
  3. Create/edit platform defaults (visible to all vendors)

Via Vendor Dashboard

  1. Log in to vendor dashboard: /vendor/{code}/login
  2. Navigate to Content Pages section
  3. View platform defaults
  4. Create vendor-specific overrides

Via API

Admin - Create Platform Default:

POST /api/v1/admin/content-pages/platform
{
  "slug": "about",
  "title": "About Us",
  "content": "<p>...</p>",
  "is_published": true,
  "show_in_footer": true
}

Vendor - Create Override:

POST /api/v1/vendor/{vendor_code}/content-pages
{
  "slug": "about",
  "title": "About Our Store",
  "content": "<p>Custom content...</p>",
  "is_published": true
}

Public - Retrieve Page:

GET /api/v1/shop/content-pages/{slug}

How the Two-Tier System Works

Lookup Priority

When a customer visits /about:

  1. Check vendor override - Does this vendor have a custom "about" page?
  2. Fallback to platform - If not, use the platform default "about" page
  3. 404 if neither - Return 404 if no page exists

Example Scenario

Platform Default:

  • Slug: about
  • Title: "About Our Platform"
  • Content: Generic platform description

WizaMart Override:

  • Slug: about
  • Title: "About WizaMart"
  • Content: WizaMart-specific content

Result:

  • wizamart.shop/about → Shows WizaMart custom version
  • fashionhub.store/about → Shows platform default (no override)

Pages marked with show_in_footer: true automatically appear in the shop footer:

<!-- Footer automatically loads from database -->
<footer>
  <div>Quick Links</div>
  <ul>
    <li><a href="/products">Products</a></li>
    <li><a href="/about">About Us</a></li>  <!-- From CMS -->
    <li><a href="/contact">Contact</a></li>  <!-- From CMS -->
  </ul>
</footer>

Common Tasks

Add a New Default Page

python -c "
from app.core.database import SessionLocal
from app.services.content_page_service import content_page_service

db = SessionLocal()
content_page_service.create_page(
    db,
    slug='careers',
    title='Careers',
    content='<h1>Join Our Team</h1>...',
    is_published=True,
    show_in_footer=True
)
db.close()
"

Create Vendor Override

Via vendor API or dashboard - vendors can override any platform default by creating a page with the same slug.

Update Platform Default

Via admin panel or API - updates affect all vendors who haven't created an override.

Re-running the Script

The script is idempotent - safe to run multiple times:

make create-cms-defaults
# Output: "Skipped: About Us (/about) - already exists"

Existing pages are never overwritten.

Documentation

For complete CMS documentation, see:

Troubleshooting

Check show_in_footer flag:

SELECT slug, title, show_in_footer FROM content_pages WHERE vendor_id IS NULL;

Vendor override not working

Verify slug matches exactly:

SELECT vendor_id, slug, title FROM content_pages WHERE slug = 'about';

404 on content pages

  1. Check page is published: is_published = true
  2. Verify migration was applied: make migrate-status
  3. Run CMS defaults: make create-cms-defaults

Next Steps

  • Customize default content via admin panel
  • Create vendor-specific overrides
  • Add new custom pages as needed
  • Update footer navigation preferences