Expand page templates and configure page visibility

This commit is contained in:
2026-11-22 12:54:01 +08:00
parent 931d333ca7
commit f23c3b95ba
27 changed files with 293 additions and 44 deletions
+10
View File
@@ -122,6 +122,16 @@ $previewUrl = '/admin/pages/' . $slug . '/preview';
<label>页面名称<input name="name" value="<?= $e($page['name']) ?>" required maxlength="100"></label>
<label>SEO 标题<input name="title" value="<?= $e($page['title']) ?>" required maxlength="160"></label>
<label>SEO 描述<textarea name="description" rows="2" maxlength="300"><?= $e($page['description']) ?></textarea></label>
<fieldset class="admin-options form-grid">
<legend>页面显示</legend>
<?php foreach (['header' => '页头', 'hero' => '首屏', 'footer' => '页脚'] as $area => $label): ?>
<?php $visible = $page['visibility'][$area] ?? true; ?>
<label><?= $e($label) ?><select name="show_<?= $e($area) ?>">
<option value="1" <?= $visible ? 'selected' : '' ?>>显示</option>
<option value="0" <?= !$visible ? 'selected' : '' ?>>隐藏</option>
</select></label>
<?php endforeach ?>
</fieldset>
<?php
$contentFields = [
'heading' => $page['heading'], 'accent' => $page['accent'], 'lead' => $page['lead'],