Here some explanations to know how my Content Management System (CMS4_aldana) is working roughly.
Learning with metaphors
I came to the point that it is more fun to tell a metaphor-story which describes a software system. Further more I guess it is easier to understand what is happening behind the scenes by having some practical real life comparison.
Sushi bar metaphor
I am using a japanese bar-restaurant as my metaphor. In my sushi bar there are certain things, so you have a nice time and meal:
- You sit down to eat your sushi dish.
- The owner of the sushi bar decided, that the served dish has got a standard layout
- A nice waitress, who is writing down your orders and serving you a nice dish.
- A cook who is making you a sushi dish.
- It is a cook trainee, to find the ingredients he uses a larder guide.
- The cook uses ingredients to prepare the sushi..
Sushi dish
Well that’s why you entered the bar. You’re starving and want to eat something. So what to do about it? Get yourself a sushi dish! In CMS4_aldana the sushi itself is what you see in your browser: let it be a travel report or a life vitae, it is the page you clicked to (your ordered sushi) and want to read through .
Sushi layout
Japanese restaurant chiefs put a lot of effort so all customers can expect that all sushi dishes are composed in a standard way, no matter which cook helper prepared it: Dip of soya with wasabi on the left top, the sushi itself right in front of you and the ginger very close to the sushi. In this restaurant’s case (because the cook is busy at work all the time) the waitress is helping the cook with layouting the sushi plate, so the cook only needs to put the sushi thing (wasabi, sushi etc.) on the plate.’
Similar it works with CMS4_aldana. You once define a standard look and feel, so you decide the layout/composition of all your pages of your website:
- What: display menu, category-list, pathway etc.,
- Where: layout menu leftmost, main-content in the center etc.,
- How: display menu with big, bold, white font on green background
The composition is implemented by two files which I refer to as template-files:
- template.php5: a script, which defines the ‘what’ and ‘where’.
- template_css.css: a stylesheet definition file, which defines the ‘how’.
Waitress
The waitress is the person you’re giving up the orders to. She comes to you when you raise your hand and she writes down on her notebook which sushi dish you would like to eat. She passes the order to the cooks in the kitchen and after very short time
(this restaurant is well known to be very quick) gets back to serve you a very nice piece of meal.
It is very similar in CMS4_aldana. There is a single point of entry (->index.php5), where you decide which site you want to see. Every request (that means url) you are sending to the webserver has got an additional html GET-paramenter which tells which site you wanna eat….., well I mean see.
Cook
The waitress has written down your order. Well, somebody has to prepare the sushi, right? That’s the job of the cook, he looks at the order and because he is a trainee he still must look at a recipe book. Remember that our sushi bar has got strict orders how a sushi plate has to be composed. So after having done the dish’s bits and pieces (soya, ginger etc.) the cook is placing them like instructed in the template.
Well, guess what: something cook-like is happening in CMS4_aldana. There are PHP-scripts which look up the configuration and generate parts of the (sushi) page:
- Menu of your website
- Pathway of your website
- Category-list of your website
- Parent Navigation of your website.
Larder guide
Because the cook is a trainee he still is not sure where to find the ingredients in the larder. The recipe book tells the cook, how the dish should be prepared. For instance if the customer ordered a tuna sushi he has to look in the recipe book how much to take from an ingredient (e.g. fish) and where to add it. Similar guidelines happen in CMS4_aldana: there is a configuration file, which tells PHP-scripts where to find the user provided content for the requested site. Apart from that it tells whether the content (ingredient) is a menu item or a category.
Ingredients
A cook has to choose from ingredients and the prepare the sushi dish from it. This can be tuna, salmon or similar. In CMS4_aldana the main ingredient is the content file you are writing for your website.