[CMS-VISUAL] F2: 门户布局区块输出稳定 id + data-plb-id 锚点(display:contents 零布局影响)+ postMessage 预览监听脚本(门户侧 50 测试绿)

This commit is contained in:
chenxing
2026-09-28 12:52:45 +08:00
parent c60f9dffb7
commit 089cb54011
5 changed files with 69 additions and 3 deletions
@@ -26,8 +26,12 @@
<!-- 首页布局模式(docs/16 §4.4):home_layout 落库后按区块序列渲染(common 兜底骨架,本主题不另设形态) -->
<th:block th:if="${layoutBlocks != null}">
<th:block th:replace="~{'themes/common/fragments/home-blocks' :: style}" />
<th:block th:replace="~{'themes/common/fragments/home-blocks' :: previewScript}" />
<!-- F2:data-plb-id 锚点(display:contents)供编辑器实时预览 postMessage 重排 -->
<th:block th:each="block : ${layoutBlocks}">
<th:block th:replace="~{'themes/common/fragments/home-blocks' :: render(${block})}" />
<div class="plb-anchor" th:attr="data-plb-id=${block['id']}" style="display:contents">
<th:block th:replace="~{'themes/common/fragments/home-blocks' :: render(${block})}" />
</div>
</th:block>
</th:block>