- SimpleCMS
- 29 Jul 2008 10:57:04 pm
- Last edited by swivelgames on 05 Aug 2008 06:12:44 pm; edited 2 times in total
SimpleCMS has been something I've wanted to actually release for a very long time, though I have also reasons why it has taken this long to actually develop a "releasable copy".
Its been my goal for a VERY long time to try and develop and extremely simple and easily usable content management system.
Right now I'm working on possibly my first version that could actually lead to SimpleCMS's first actual release!
I'll be working on hosting a demo up on my website as well as a link to the source of the stable releases.
Heres how it works right now.
The templating system works a lot like a Wiki page's source. Basically you type in a series of short-hand codes to create your output along with things like line-breaks as <br /> tags as well as HTML support. As an example I'm going to use the page in the database Home.
Home's Source:
Code:
Home is a "page" type template. This means that the page can be viewed through the browser by using "Home" as the file name (wikis use the same method for viewing documents by making the location of the document the document's title). "chunk" templates are used for things like the header and the footer which cannot be viewed by directly linking yourself to it. The syntax of the tag is as follows:
Code:
In the first source you'll see a tag with the type "element".
Elements are much different then pages or chunks.
Each element has its own corresponding table in the database. Depending on the columns and column types in the table will depend on how and what will display. Each element has a template that goes with it that will manipulate how the element will present itself on the page. Basically you are able to add and remove elements from the database. As an example, the News element has a table set up like this:
Code:
When the program sees `cms_page_elements` it identifies that `cms_news` is attached to the News element. It checks out the table and sees that there is `id` as the primary key. This is automatically placed by the CMS when you add a new element so that there is always a unique property to each row. It goes through the rest and retrieves the properties of each column for later reference. When it is told to output it grabs the template column from the `cms_page_elements` table in the "News" row. It then stiches together each item from the `cms_news` table into the template. If there is more then one item and the `disp_type` column in the page_elements table is set it multiple then it runs through and concatenates each finished template into one big output string and sends it on through to be replaced with [#News#] in the template.
Now for the Post_News page. As you may have noticed in, there was a link in the previous template for the page "Home".
Below is "Post_News"s template:
Code:
The next type as you can see is "form". Basically what that does is it generates a form depending on the columns and the needed properties for each row in the table. When you submit, it of course posts it in the DB with necessary NULLs and what not ^^,
So far thats about it!
I know thats a bit of a messy explanation but I'm just kind of throwing that up there to kind of try and explain how it all works.
Right now I have a simple little example up on my home server, which is public now that I have moved and have a better service
I'd rather not post up my IP up on a public forum but I'd love to show anyone who wants to see it. If you want to see it just send me a PM. Right now theres really nothing but an example for how you would make something like a news or a blog site.
EDIT:
I've just recently updated the template system to use only one tag with different parameters, allowing easy implementation of other developer's own "types" for use with their add-ons and such.
I'm going to be adding some different things to the template system, mostly to help out those who don't know much layout or CSS, and also to make it easy for those who DO know to code it much easier within the CMS
Its been my goal for a VERY long time to try and develop and extremely simple and easily usable content management system.
Right now I'm working on possibly my first version that could actually lead to SimpleCMS's first actual release!
I'll be working on hosting a demo up on my website as well as a link to the source of the stable releases.
Heres how it works right now.
The templating system works a lot like a Wiki page's source. Basically you type in a series of short-hand codes to create your output along with things like line-breaks as <br /> tags as well as HTML support. As an example I'm going to use the page in the database Home.
Home's Source:
Code:
{{Header chunk}}
<div class="news">
{{News element LIMIT:5 ORDER:ASC}}
</div><br /><br /><a href="Post_News">Add a new post</a>
{{Footer chunk}}
Code:
{{reference type [param1:value [param2:value [...]]]}}
In the first source you'll see a tag with the type "element".
Elements are much different then pages or chunks.
Each element has its own corresponding table in the database. Depending on the columns and column types in the table will depend on how and what will display. Each element has a template that goes with it that will manipulate how the element will present itself on the page. Basically you are able to add and remove elements from the database. As an example, the News element has a table set up like this:
Code:
+---------+--------------+----------------+-----------+
| id | title | body | date |
| int(11) | varchar(255) | text | timestamp |
+---------+--------------+----------------+-----------+
| 1 | Test | Testing? | CRNT_TIME |
| 4 | Test Post | hey all, th... | CRNT_TIME |
+---------+--------------+----------------+-----------+
Now for the Post_News page. As you may have noticed in, there was a link in the previous template for the page "Home".
Below is "Post_News"s template:
Code:
{{Header chunk}}
<div class="news">
{{News form}}
</div><br /><br /><a href="Home">View news posts</a>
{{Footer chunk}}
The next type as you can see is "form". Basically what that does is it generates a form depending on the columns and the needed properties for each row in the table. When you submit, it of course posts it in the DB with necessary NULLs and what not ^^,
So far thats about it!
I know thats a bit of a messy explanation but I'm just kind of throwing that up there to kind of try and explain how it all works.
Right now I have a simple little example up on my home server, which is public now that I have moved and have a better service
I'd rather not post up my IP up on a public forum but I'd love to show anyone who wants to see it. If you want to see it just send me a PM. Right now theres really nothing but an example for how you would make something like a news or a blog site.
EDIT:
I've just recently updated the template system to use only one tag with different parameters, allowing easy implementation of other developer's own "types" for use with their add-ons and such.
I'm going to be adding some different things to the template system, mostly to help out those who don't know much layout or CSS, and also to make it easy for those who DO know to code it much easier within the CMS