fix page settings section and blocks not showing in editor
All checks were successful
deploy / deploy (push) Successful in 1m16s
All checks were successful
deploy / deploy (push) Successful in 1m16s
Two bugs fixed: 1. Page Settings section wasn't appearing for system pages because Defaults.for_slug didn't return all required fields (type, meta_description, published, etc). Also changed page_renderer to use bracket notation for safer field access. 2. Blocks weren't loading when navigating directly to ?edit=page because the PageEditorHook's handle_params ran before Shop.Page assigned @page. Added pending page mode mechanism: hook sets a flag when edit mode is requested but @page is nil, then Shop.Page calls maybe_enter_pending_page_mode after @page is assigned. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -641,10 +641,8 @@ defmodule BerrypodWeb.ShopComponents.SiteEditor do
|
||||
class="site-editor-nav-item"
|
||||
data-item-id={item.id}
|
||||
>
|
||||
<%
|
||||
# Determine if this item links to a known page (by URL match or page_id)
|
||||
is_page_link = item.page_id != nil or MapSet.member?(@page_urls, item.url)
|
||||
%>
|
||||
<% # Determine if this item links to a known page (by URL match or page_id)
|
||||
is_page_link = item.page_id != nil or MapSet.member?(@page_urls, item.url) %>
|
||||
<form
|
||||
class="site-editor-nav-item-form"
|
||||
phx-change={@event_prefix <> "update_nav_item"}
|
||||
|
||||
Reference in New Issue
Block a user