Mecha CMS

Add extra functionality to the core engine.

Archive

Table of Contents
  1. Conditions 
  2. Classes 

List all pages in the current folder filtered by time.

Download Version 1.0.1 Download Development Version

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

This extension activates the time filter feature by utilizing the time property of the page to add several routes such as https://mecha-cms.com/blog/archive/:date on every page to allow users to list all pages in the current folder by time.

As a note, every time you want to link a page to a specific year-based archive, be sure to add the pagination offset to the end of the URL to prevent Mecha from mistakenly interpret the archive year as pagination offset:

https://mecha-cms.com/blog/archive/2020 ✘
https://mecha-cms.com/blog/archive/2020/1 ✔

Other than that are safe enough, even though I would prefer you to add it anyway, for consistency:

https://mecha-cms.com/blog/archive/2020-09/1
https://mecha-cms.com/blog/archive/2020-09-18/1

Conditions 

These page conditional statements are available:

  • $site->is('archives') → Return true if current items view is an archives view and is not empty.

Classes 

These HTML classes will be added to the <html> element that has a class attribute:

  • is:archives → Will be added if current items view is an archives view and is not empty.

0 Comments

No comments yet.