Add the ability to create blog pages and blog-posts.
This commit is contained in:
17
templates/blog-post.php
Normal file
17
templates/blog-post.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?= snippet("header") ?>
|
||||
|
||||
<?= snippet("page/title", ["showDate" => true]) ?>
|
||||
|
||||
<?= $page->text()->kirbytext() ?>
|
||||
|
||||
<hr class="mb-3">
|
||||
|
||||
<?php if (($user = $kirby->user()) and $user->role()->isAdmin()) : ?>
|
||||
<div class="clearfix mb-3">
|
||||
<div class="float-end">
|
||||
<a href="<?= $page->panel()->url() ?>" target="_blank"><?= kirbytag("fa", "edit") ?></a>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
<?= snippet("footer") ?>
|
||||
21
templates/blog.php
Normal file
21
templates/blog.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?= snippet("header") ?>
|
||||
|
||||
<?= snippet("page/title") ?>
|
||||
|
||||
<?php if (count($posts)) : ?>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<?php foreach ($posts as $post) : ?>
|
||||
<?= snippet("collection/post", ["post" => $post]) ?>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php else : ?>
|
||||
<div class="alert alert-info mb-3">
|
||||
No posts have been created yet!
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
<?= snippet("page/pagination", ["pagination" => $posts->pagination()]) ?>
|
||||
|
||||
<?= snippet("footer") ?>
|
||||
Reference in New Issue
Block a user