fix(cms): storefront renders sections for landing pages + fix nav URLs
Two critical fixes for POC site rendering: 1. Storefront content page route now selects template based on page.template field: 'full' → landing-full.html (section-based), 'modern'/'minimal' → their respective templates. Default stays content-page.html (plain HTML). Previously always used content-page which ignores page.sections JSON. 2. Storefront base_url uses store.subdomain (lowercase, hyphens) instead of store.store_code (uppercase, underscores) for URL building. Nav links now point to correct paths that the store context middleware can resolve. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -109,8 +109,16 @@ async def generic_content_page(
|
||||
context = get_storefront_context(request, db=db, page=page)
|
||||
context["page_content"] = page_content
|
||||
|
||||
# Select template based on page.template field
|
||||
template_map = {
|
||||
"full": "cms/storefront/landing-full.html",
|
||||
"modern": "cms/storefront/landing-modern.html",
|
||||
"minimal": "cms/storefront/landing-minimal.html",
|
||||
}
|
||||
template_name = template_map.get(page.template, "cms/storefront/content-page.html")
|
||||
|
||||
return templates.TemplateResponse(
|
||||
"cms/storefront/content-page.html",
|
||||
template_name,
|
||||
context,
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user