This commit is contained in:
2026-08-08 17:19:44 +08:00
parent 9276ed7358
commit dc0d2622f3
76 changed files with 1384 additions and 376 deletions
+4 -3
View File
@@ -2,7 +2,8 @@
$n = $n ?? null;
$layoutArr = [];
if (!empty($n['layout'])) { $d = json_decode($n['layout'], true); if (is_array($d)) $layoutArr = $d; }
$hasCanvas = !empty($layoutArr);
// 模式渲染:可视化编辑(builder)且有 layout → 画布;否则固定版式(正文富文本)
$useBuilder = !empty($layoutArr) && ($n['mode'] ?? '') !== 'fixed';
?>
<section class="page-hero">
<div class="container">
@@ -14,12 +15,12 @@ $hasCanvas = !empty($layoutArr);
<nav class="breadcrumb"><a href="<?php echo site_url(); ?>">首页</a> / <a href="<?php echo site_url('news'); ?>">新闻动态</a> / <?php echo e($n['title']); ?></nav>
</div>
<?php if ($hasCanvas): ?>
<?php if ($useBuilder): ?>
<?php echo \Core\View::buffer('parts/canvas', ['layout' => $layoutArr, 'item' => $n, 'module' => 'news']); ?>
<?php else: ?>
<section class="section" style="padding-top:10px">
<div class="container" style="max-width:780px">
<article class="detail-desc" style="font-size:16px"><?php echo e($n['content']); ?></article>
<article class="detail-desc detail-rich" style="font-size:16px"><?php echo $n['content']; ?></article>
</div>
</section>
<?php endif; ?>