-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
enhancementNew feature or requestNew feature or request
Description
It would be beneficial if we could easily extend the existing pages endpoint, specifically using Django CMS page extensions.
Scenarios:
- SEO and Opengraph settings automatically attached to page if flag is set in model/extension
- Special field types, like page image (if not already covered by SEO), page icons, or specific color values available to the editor
- FK relations to Django apps using additional serializers, similar to plugins. This would allow assigning contacts or departments to a page without the need of using plugins. On the level of information architecture, I think a plugin is strictly content, while a page extension is for “meta-like” content.
- tagging system, which needs an additional filter on pages and menus api views
Response
{
"title": "Home",
"page_title": "Home",
"menu_title": "Home",
"meta_description": "Welcome to our official website providing information and services.",
"redirect": "",
"in_navigation": true,
"soft_root": false,
"template": "home.html",
"xframe_options": "",
"limit_visibility_in_menu": false,
"language": "en",
"path": "",
"absolute_url": "https://www.example.org/",
"is_home": true,
"login_required": false,
"languages": ["en"],
"is_preview": false,
"application_namespace": "",
"creation_date": "2025-09-15T14:55:00.036185Z",
"changed_date": "2025-10-06T10:50:25.039706Z",
"details": "https://www.example.org/api/cms/en/pages/",
"placeholders": [
{
"content_type_id": 5,
"object_id": 95,
"slot": "content",
"details": "https://www.example.org/api/cms/en/placeholders/5/95/content/"
}
],
"extensions": [
{
"name": "seo",
"seo_title": "Example Organization – Official Site",
"meta_description": "Learn more about our services, departments, and upcoming events.",
"canonical_url": "https://www.example.org/",
"meta_keywords": ["organization", "services", "news", "events"],
"robots_index": true,
"robots_follow": true,
"open_graph": {
"og_title": "Example Organization – Welcome",
"og_description": "Explore our official website for the latest updates and resources.",
"og_type": "website",
"og_url": "https://www.example.org/",
"og_image": "https://www.example.org/static/img/social/og-default.jpg",
"og_locale": "en_US",
"og_site_name": "Example Organization"
},
"twitter_card": {
"card": "summary_large_image",
"title": "Example Organization – Welcome",
"description": "Official website with information and services for the public.",
"image": "https://www.example.org/static/img/social/twitter-default.jpg",
"creator": "@example_org"
},
"structured_data": {
"@context": "https://schema.org",
"@type": "Organization",
"name": "Example Organization",
"url": "https://www.example.org/",
"logo": "https://www.example.org/static/img/logo.svg"
}
},
{
"name": "appearance",
"page_image": "https://www.example.org/media/images/hero_home.jpg",
"page_icon": "mdi-home-outline",
"theme_color": "#003366"
},
{
"name": "relations",
"contacts": [
{
"id": 1,
"name": "Public Information Office",
"email": "[email protected]",
"phone": "+1-555-123-4567",
"url": "https://www.example.org/contact/"
}
],
"departments": [
{
"id": 10,
"name": "Communications Department",
"url": "https://www.example.org/departments/communications/"
}
]
},
{
"name": "taxonomy",
"tags": ["services", "community", "information"],
"categories": ["Public Information"]
}
]
}
Implementation
- Custom serializer to allow the endpoint to be fully typed; otherwise, fall back to generic serializer (not fully typed, depending on model complexity).
- Use a specific setting like
add_api_fields = True - Describe a simple pattern to add this custom endpoint, as we likely have to replace the normal API endpoint. Keep URLs so we can easily enable and disable features.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request