View Full Version : How to Learn to Build Simple CMS
Steven
06-27-2007, 07:02 AM
Hi all, I am a newbie when it comes to web coding, and certainly no expert in 'dynamic languages' eg ASP, PHP, etc. Am learning though.
However, I'd really like to know how can I build a simple simple CMS system? I know, I probably need to have working knowledge of databases, etc.
Is there a good source to learn? Or rather for me, start learning. I've been relying on W3 schools for a while, but I don't get any info on how to build CMS. And I really mean simple one for a start.
Sorry I know I sound ambitious with the little knowledge I have, but I am seriously interested to learn. Maybe a guru here can point out to me?
Ok, my end intention is this; I want to be able to offer and build CMS, albeit simple. There are, I understand, free open source CMS for download, right?
Many thanks in advance
djr33
06-27-2007, 08:37 AM
This isn't too ambitious, though it's something you'll need to dive into and figure out. I expect you should be capable, though.
For a simple explanation, I'll go word by word (not to patronize you, but just for organization):
CMS - Content Management System
Content:
Well, here's your stuff. The important part here is not the content itself (obviously important in the end, but I'm sure you can figure out the actual content on your own), but the way it is stored. Is the content text? images? files? etc. Though any type of data could be used, the most basic (and almost surely needed) is text.
You should consider how you are going to use this. For something as complex as a forum, a database is definitely needed, since it must be accessed quickly and in many dynamic ways. Searching for things, etc., is also good in a database.
However, an alternative would be using plain text files stored on the server. This offers less accessible control (since a database is specifically designed for this), but is in some ways simpler, and less to deal with than actually setting up a database. If what you are doing is simple, then this is probably the answer. (I wrote a comment script a while back and it was simple-- just stored comments to a text file, so that worked out fine, without need for a database. Anything more complex, though, would have needed a database, probably.)
Management:
Here's the other thing you'll need to make. This will consist of four parts:
1. Your forms (generally you can use html forms to get data to the PHP code).
2. Any javascript making these forms fancy, if needed/desired.
3. A way of managing use, such as with a user system or admin password. (Look into PHP sessions for this.)
4. Actual use of this to manage the content, which brings us to:
System:
This is the PHP script (or another language) that gets the data from the database, or saves the data, or reads a text file, etc.
This is obviously the hardest part.
I'd suggest looking at this intro tutorial for PHP and MySQL:
http://php-mysql-tutorial.com
That should give you some basic info with PHP, then continues with MySQL. I'd suggest starting with that even if you don't plan to use a database, since the first couple lessons are just basic PHP.
And don't forget about www.php.net -- though it is a bit daunting at first, it is a great reference for functions if you need to know specific information about one in particular. Use the search bar in the upper right.
Another big factor in all of which is exactly what type of content you are managing. If you can specify this a bit, we might be able to give a more precise example. What I explained above should generally fit, though a specific type of site, such as a photo gallery, would some different strategies.
Steven
06-28-2007, 10:06 AM
thanks Djr33 for the comprehensive reply. Alright, looks like PHP for a headstart!!
If you use PHP, I suggest you also use something like Smarty (http://smarty.php.net/), or your code is going to end up looking horrible. Perhaps something like Python/Django or Java servlets would be a better choice.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.