Quantcast
Viewing all articles
Browse latest Browse all 3

LemonStand 2 Features: CMS

The current version of LemonStand demonstrated that we took the CMS implementation in the right direction. LemonStand’s CMS is simple, non-restrictive and flexible. The CMS implementation in LemonStand 2 inherits all of the beauty from the first version and goes further with making it more developer friendly.

Full control through the file system

Historically LemonStand 1 keeps all CMS templates in the database. The file-based templating engine, that was added later on top of the existing system, still relies on the database. This poses a number of problems. Some page properties are stored in the database. This means that you cannot change a page’s URL through updating a template file. You need to go to the back-end and use the Edit Page form. It might not seem like a big deal, but this makes updating the website via Git inconvenient, especially if you want to push multiple new pages.

The new CMS implementation doesn’t depend on the database at all. This not only makes the engine faster, but also gives you the option to use your favorite code editor and version control system for managing your websites. Every bit of information about pages, partials, templates and themes is stored in the file system. This gives you full control over the website content with Git or any other version control system. You can add pages locally, push the updates to the Git repository, and deploy the new stuff on the live site. Voila! We believe the streamlined workflow will be appreciated by individual developers and web agencies.

To convey the the page attributes through file templates we extended the normal HTML/PHP (or Twig) templates with a simple YAML header. This is an example of a simple page template header:

---
action: shop:product
template: default
title: Products
url: /products/:urlName
---
<h2><?= h($product->name) ?></h2>
...

Stricter URL patterns

Page URLs in LemonStand 2 are more flexible and SEO friendly. In the previous version any URL segment that is appended to the base page URL is considered as a parameter. This applies limitations to the URLs – dynamic parameters can only be appended to the base URLs. For example, in LemonStand you can’t create an URL like this:

/authors/:author/details and /authors/:author/edit

You can do it in LemonStand 2. You can even use regular expressions to make your URLs more strict. URL parameters in the new version are named, so you can move a parameter in the URL pattern without breaking the functionality.

Other great stuff

There are lots of updates in the CMS engine in the upcoming LemonStand, including the new UI (we are experimenting on it still), better caching implementation and improved performance. They will be covered in upcoming articles of the LemonStand 2 Features series.

Aleksey Bobkov is a CTO and co-founder at LemonStand. A masterful programmer, Aleksey applies his skills to develop, guide and oversee all technical aspects of the LemonStand platform. He ignores the status quo and relentlessly finds better solutions to technical challenges.

Viewing all articles
Browse latest Browse all 3

Trending Articles