From bbecb8e242e24464f00818b661bd686a44745169 Mon Sep 17 00:00:00 2001 From: Dan Date: Tue, 25 Mar 2025 23:17:13 +0700 Subject: [PATCH] Update htmly.php Allows custom template files for subpages: layout--[subpage-slug].html.php, layout--substatic.html.php, substatic--[subpage-slug].html.php, substatic.html.php --- system/htmly.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/system/htmly.php b/system/htmly.php index 2795fb9..8f0d23c 100644 --- a/system/htmly.php +++ b/system/htmly.php @@ -4925,8 +4925,14 @@ get('/:static/:sub', function ($static, $sub) { $lt = $vroot . '/layout--' . strtolower($static) . '--' . strtolower($sub) . '.html.php'; $ls = $vroot . '/layout--' . strtolower($static) . '.html.php'; $lf = $vroot . '/layout--static.html.php'; + $lsp = $vroot . '/layout--' . strtolower($sub) . '.html.php'; + $lsps = $vroot . '/layout--substatic.html.php'; if (file_exists($lt)) { $layout = 'layout--' . strtolower($static) . '--' . strtolower($sub); + } else if (file_exists($lsp)) { + $layout = 'layout--' . strtolower($sub); + } else if (file_exists($lsps)) { + $layout = 'layout--substatic'; } else if (file_exists($ls)) { $layout = 'layout--' . strtolower($static); } else if (file_exists($lf)) { @@ -4937,8 +4943,14 @@ get('/:static/:sub', function ($static, $sub) { $pv = $vroot . '/static--' . strtolower($static) . '--' . strtolower($sub) . '.html.php'; $ps = $vroot . '/static--' . strtolower($static) . '.html.php'; + $psp = $vroot . '/substatic--' . strtolower($sub) . '.html.php'; + $psps = $vroot . '/substatic.html.php'; if (file_exists($pv)) { $pview = 'static--' . strtolower($static) . '--' . strtolower($sub); + } else if (file_exists($psp)) { + $pview = 'substatic--' . strtolower($sub); + } else if (file_exists($psps)) { + $pview = 'substatic'; } else if (file_exists($ps)) { $pview = 'static--' . strtolower($static); } else {