Add visual header and footer layout editors

This commit is contained in:
2026-11-23 20:30:11 +08:00
parent 4e3964a6eb
commit 636788b65c
16 changed files with 714 additions and 95 deletions
+31
View File
@@ -0,0 +1,31 @@
<?php
use App\Content\DesignLibrary;
use App\Content\View;
$layout = [
'id' => 0,
'preset' => $preset,
'payload' => array_replace(DesignLibrary::defaults($kind), [
'brand' => '品牌名称',
'text' => '关于网站的一句话介绍。',
'links' => $layoutEditor ? [] : [['/', '首页'], ['/articles', '文章']],
'legal' => '© 品牌名称',
'action' => [['/articles', '了解更多', 'solid', false]],
]),
];
?>
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/assets/site.css">
<link rel="stylesheet" href="/assets/design-editor.css">
</head>
<body class="design-frame <?= $layoutEditor ? 'design-frame-editing' : 'design-frame-sample' ?>">
<?= View::fragment($kind, [
$kind => $layout, 'site' => ['name' => '品牌名称'], 'showHeader' => true, 'showFooter' => true,
'path' => '/', 'visitor' => null, 'member' => $preset === 'member', 'layoutEditor' => $layoutEditor,
]) ?>
</body>
</html>