Mecha CMS

Add extra functionality to the core engine.

Page Excerpt

Table of Contents
  1. Usage 

Add manual page excerpt feature.

Download Stable Version Download Development Version

Something looks broken? We accept bounties to fix them faster.

^331 Downloads
v1.0.10277 Downloads
v1.0.9209 Downloads
v1.0.8193 Downloads

Usage 

How to enable the page excerpt manually:

---
title: Post Title
description: Post description.
author: Taufik Nurrohman
type: Markdown
...

This paragraph is going to be the page excerpt.

<!-- cut -->

Rest of the page content goes here.

To show the manual page excerpt in your layout:

<?php foreach ($pages as $page): ?>
<article>
  <h3>
    <?= $page->title; ?>
  </h3>
  <?= $page->excerpt; ?>
  <p>
    <a href="<?= $page->url; ?>#next:<?= $page->id; ?>">
      Read More
    </a>
  </p>
</article>
<?php endforeach; ?>