Processwire — CMS/framework with a nice API
I've been using Processwire in three of my projects. One of that was Rest API for single-page application on React. Others were just casual corporate websites.
The best part of Processwire is it's extremely useful API designed in a jQuery-style.
Sometimes it reminds me ModX: it has pages
(same as of ModX resources
), for every page you can assign a templates
and variables
.
In contrast to Wordpress there is no default page fields except title
and there are no chunks which are commonly used in ModX. All fields are template variables. Any logic is made using plugins or hooks.
The core entity here is the page
. It's like a node in Drupal. Any section is a page, article is a page, even the user is a page here.
API usage examples
Current page can be accessed using $page
:
// Get current page title echo $page->get("title"); // Breadcrumbs echo "<ul>"; foreach ($page->parents as $parent) echo "<li><a href='{$parent->url}'>{$parent->title}</a></li>"; echo "</ul>"; // Get random image $image = $page->images->getRandom(); if ($image) echo "<img src='{$image->url}'>";
You can access any page using $pages
:
// Get the title of particular page echo $pages->get("/shop/category/product1/")->title; // Get all devices, released after 2014 with a screen wider than 4" sorted by vendos $phones = $pages->find("template=phones, year>2014, screen>=4, sort=-vendor");
Do you see how simple is that? It's almost literally just spoken words.
It has hooks, caching, good i18n support, themes, plugins and a great community. It is in actively developed according to roadmap.
If you tired of ModX, want more flexibility than Wordpress or just looking for something new you definetely should try Processwire.