How do you keep visitors returning to your website? By updating content regularly. Maintaining this gets out of hand unless you have a content management system. Harish Kamath explains how to put a barebones CMS together using three APIs. To see the VIDEO TUTORIAL click HERE.
Free companion video tutorial for this article! Click Here!
Now that Iíve set up the application, it is time to take yaapi for a quick test ride. Well, not so fast; it is pointless to have a CMS without any content.
Time to rectify this little anamoly. I load the yaapi admin module by pointing my browser to the following URL - http://localhost/yaapi/admin/. You should view the following screen in your browser.
Note that you may have to replace "localhost" with the name of the server where youíve installed the application. For my initial demonstration, I click on the "New" button in the "Categories" section to load the following screen that allows me to add categories and ...
.... then, I click the "New" control of the "Articles" section to add an "Article" using the following form:
Note that you have to set the "Approved" flag to "Y," otherwise the article will not be available for display on the website. With the insertion of content into the database complete, it's time demonstrate how to display a simple listing of articles using yaapi. And to make things easier -- at least, for me -- the yaapi distribution contains a set of sample scripts in the "demo" directory.
For example, I can view the article that Iíve just inserted using the following URL: http://localhost/yaapi/demo/intros.php.
You should view something like this:
While the output may not appear fancy at first glance, it does serve the purpose of demonstrating the capabilities of yaapi. Some of you might complain that I breezed through the admin screen. However, thereís no reason to despair because all will be unraveled in due course; thatís a promise.
Same Time, Same Website -- Next Week
Thatís about it for this first part of my tutorial on building a barebones CMS. I started the article by giving a quick introduction to the different APIs that I intend to use. These are yaapi, a useful API to manage content stored in a MySQL database; patTemplate, a versatile templating engine; and patUser, a nifty tool to manage users and permissions developed by the team behind patTemplate.
Next, I gave you a step-by-step outline of how to install and configure the yaapi application on your web server. Then, I showed you a quick workaround to ensure that you can update your configuration without having to edit the core API files. Finally, I gave you a whirlwind tour of the yaapi admin module, followed by a demonstration of the yaapi APIs.
In the next part, I shall explain the twin concepts of "categories" and "articles" in the context of "yaapi." It is critical to understand these concepts in order to leverage the capabilities provided by yaapi. Next, I will also demonstrate the true power of yaapi: the properties and methods of the "article" class that help to retreive content from the database and display it on the web page.