📜 ⬆️ ⬇️

demiurGo.cms Introduction

History of creation.


“Do today what others only think about tomorrow ...”
Socrates.


In 2005, while working as a typesetter in a single web studio, I first encountered the concept of CMS, the first system I met with was NetCat, or rather, all that was left of it after hard bullying and processing by local programmers.
I was struck by the ease of management of this product, but there were of course, and the disadvantages of which were shaking.
Then I had the idea to create my own system, with which I will be friends.
After re-reading tons of literature and taking a lot of patience and kilos of coffee in the baggage, I began to develop.


"The first pancake is lumpy, but add caviar and it will turn out even very little"
My first CMS was a system called HCMS (by the way, I noticed a tendency to call my products with the prefix of my nickname among most developers). It took about 3 months, but the result certainly did not suit me - too much useless code for a very flawed functionality. And like a real "poet" - I burned the manuscript in the hope of enlightening the models in my head.
Having gained a lot of experience with each new version, I started getting better and better. By the end of 2007, the slightly damp and burnt HCMS pro v6 product was obtained. Yes! - I deleted tons of code from a screw 5 times, but after a few months of testing the new system, I had to remove it for the 6th time.
')
"Despair - the privilege of the weak in spirit"

After a short break in half a year, I again opened the “notebook” and studied several popular CMS - again I took up the old one.

I will draw a line under the lyrical digression: do not drink a lot of coffee - it will destroy you!

Principle of operation


Analyzing the structure of web sites - the system can be decomposed into several components:

- Registration
- Structure
- Content

All these components should depend on each other as follows:
The system determines the current section, connects the associated design template and injects where necessary the content intended for this section.
Everything is very simple at first glance, but the question arises - how?

Part 1. Design.


I didn’t resort to ready-made “tempered” solutions and bother much in this area. He set the task: there is a set-up design and it needs to be pulled on the system without much effort and in order to take from five to ten minutes.

<html>
<head>
<meta http-equiv= "Content-Type" content= "text/html; charset=utf-8" >
<title><?=$ this -> _pageINFO[ "name" ] ?></title>

<?=$ this ->head()?>

</head>

<body>
<?=$ this -> adminpanel() ?>
<?=$ this -> content() ?>

</body>
</html>


* This source code was highlighted with Source Code Highlighter .


That's all, this is the easiest example that I can give. And now in order:

$ this -> _ pageINFO - an array containing information about the current section
$ this-> head () - the function of connecting all the most necessary CSS, JS, etc.
$ this-> adminpanel () - output function of the admin panel
$ this -> content () - content output function

These are the most necessary implementations in the template, without them, of course, it’s also possible to live, but then there’s no way to use CMS.

Each template is attached CSS and JS file - so that it was convenient)

Part 2. Structure.


Each site has a structure. We create a set of sections and subsections by manually specifying a binding to the design and functionality.

In the main content class, data about the current section is stored in the $ this -> _ pageINFO array , the address (url) of the current section can be determined via $ this-> FullUrl () , and the url of another section can be determined through its id $ this-> FullUrl (' id - section ') .

Part 3. Content.


As you already understood the content, no matter how it was, it is called inside the template - the design through the $ this-> content () function and is determined by the functionality specified when creating the section.

The functional is divided into two variations:
- System component
- Component (configurator)

Learn more about the components in the next series ...

Attention! The system passes beta testing.
For those that want to "drive" here is the link .

Source: https://habr.com/ru/post/56271/


All Articles