```
**Markdown Content:**
```markdown
# About Us
We are a **leading marketplace** for...
- Quality products
- Fast shipping
- Great support
```
### 2. SEO Optimization
Always provide meta descriptions:
```json
{
"meta_description": "Learn about our marketplace, mission, and values. We connect vendors with customers worldwide.",
"meta_keywords": "about us, marketplace, e-commerce, mission"
}
```
### 3. Draft → Published Workflow
1. Create page with `is_published: false`
2. Preview using `include_unpublished=true` parameter
3. Review and edit
4. Publish with `is_published: true`
### 4. Navigation Management
Use `display_order` to control link ordering:
```python
# Platform defaults
"about": display_order=1
"shipping": display_order=2
"returns": display_order=3
"privacy": display_order=4
"terms": display_order=5
# Result in footer:
About | Shipping | Returns | Privacy | Terms
```
### 5. Content Reversion
To revert vendor override back to platform default:
```bash
# Vendor deletes their custom page
DELETE /api/v1/vendor/{code}/content-pages/15
# Platform default will now be shown automatically
```
## Common Page Slugs
Standard slugs to implement:
| Slug | Title | Description | Show in Footer |
|------|-------|-------------|----------------|
| `about` | About Us | Company/vendor information | Yes |
| `contact` | Contact Us | Contact information and form | Yes |
| `faq` | FAQ | Frequently asked questions | Yes |
| `shipping` | Shipping Info | Shipping policies and rates | Yes |
| `returns` | Returns | Return and refund policy | Yes |
| `privacy` | Privacy Policy | Privacy and data protection | Yes |
| `terms` | Terms of Service | Terms and conditions | Yes |
| `help` | Help Center | Support resources | Yes |
| `size-guide` | Size Guide | Product sizing information | No |
| `careers` | Careers | Job opportunities | No |
## Security Considerations
1. **HTML Sanitization**: If using HTML format, sanitize user input to prevent XSS
2. **Authorization**: Vendors can only edit their own pages
3. **Published Status**: Only published pages visible to public
4. **Vendor Isolation**: Vendors cannot see/edit other vendor's content
## Migration Strategy
### Initial Setup
1. **Create Platform Defaults**:
```bash
python scripts/create_default_content_pages.py
```
2. **Migrate Existing Static Templates**:
- Convert existing HTML templates to database content
- Preserve existing URLs and SEO
3. **Update Routes**:
- Add generic content page route handler
- Remove individual route handlers for each page
## Future Enhancements
Possible improvements:
- **Version History**: Track content changes over time
- **Rich Text Editor**: WYSIWYG editor in admin/vendor panel
- **Image Management**: Upload and insert images
- **Templates**: Pre-built page templates for common pages
- **Localization**: Multi-language content support
- **Scheduled Publishing**: Publish pages at specific times
- **Content Approval**: Admin review before vendor pages go live
## API Reference Summary
### Admin Endpoints
```
GET /api/v1/admin/content-pages/ # List all pages
GET /api/v1/admin/content-pages/platform # List platform defaults
POST /api/v1/admin/content-pages/platform # Create platform default
GET /api/v1/admin/content-pages/{id} # Get specific page
PUT /api/v1/admin/content-pages/{id} # Update page
DELETE /api/v1/admin/content-pages/{id} # Delete page
```
### Vendor Endpoints
```
GET /api/v1/vendor/{code}/content-pages/ # List all (vendor + platform)
GET /api/v1/vendor/{code}/content-pages/overrides # List vendor overrides only
GET /api/v1/vendor/{code}/content-pages/{slug} # Get specific page
POST /api/v1/vendor/{code}/content-pages/ # Create vendor override
PUT /api/v1/vendor/{code}/content-pages/{id} # Update vendor page
DELETE /api/v1/vendor/{code}/content-pages/{id} # Delete vendor page
```
### Shop (Public) Endpoints
```
GET /api/v1/shop/content-pages/navigation # Get navigation links
GET /api/v1/shop/content-pages/{slug} # Get page content
```
## Example: Complete Workflow
**1. Platform Admin Creates Defaults:**
```bash
# Create "About" page
curl -X POST /api/v1/admin/content-pages/platform \
-H "Authorization: Bearer " \
-d '{
"slug": "about",
"title": "About Our Marketplace",
"content": "
About
Default content...
",
"is_published": true
}'
```
**2. All Vendors See Platform Default:**
- Vendor A visits: `vendor-a.com/about` → Shows platform default
- Vendor B visits: `vendor-b.com/about` → Shows platform default
**3. Vendor A Creates Override:**
```bash
curl -X POST /api/v1/vendor/vendor-a/content-pages/ \
-H "Authorization: Bearer " \
-d '{
"slug": "about",
"title": "About Vendor A",
"content": "
About Vendor A
Custom content...
",
"is_published": true
}'
```
**4. Now:**
- Vendor A visits: `vendor-a.com/about` → Shows Vendor A custom content
- Vendor B visits: `vendor-b.com/about` → Still shows platform default
**5. Vendor A Reverts to Default:**
```bash
curl -X DELETE /api/v1/vendor/vendor-a/content-pages/15 \
-H "Authorization: Bearer "
```
**6. Result:**
- Vendor A visits: `vendor-a.com/about` → Shows platform default again