Building a Barebones Content Management System: The Yaapi API
This article will show you how to use the different API methods of yaapi, which is an API tool useful for managing content. It will explain how to retrieve a list of articles, display an article on a web page, retrieve a list of categories, and more.
Welcome to the second part of my series on "Building a Barebones Content Management System." For those who missed out earlier, here is a quick refresher of the topics covered in the first part. It started by listing the reasons why I initiated the exercise of developing a custom CMS: the basic need for dynamic updating of content, quirks and limitations of popular CMS software packages and so on. So, I decided to put together a simple and flexible CMS using a bunch of readily available APIs: yaapi, a useful API to manage content; patTemplate, a Templating engine; and patUser, a tool to manage users and permissions. It does not pay to re-invent the wheel, does it?
Today, Iíll continue where I left off in the previous article. I shall show how to use the different API methods of yaapi to retrieve a list of "articles", display an "article" on a web page, retrieve a list of "categories" defined from the administration module and much more.
If the terms "articles" and "categories" sound like Greek and Latin, thereís no reason to despair. Iíll explain these concepts in the next section, which outlines how yaapi organizes content in the database. A clear understanding of these terms is essential to leverage fully on the capabilities of the API.