Welcome Guest, Not a member yet? Register   Sign In
Object-Oriented CMS Development
#1

[eluser]Unknown[/eluser]
Hello,

It seems with all major CMS out there that a major drawback is the inability to really customize it to your preferences. They are all rather limited by how the designer intended it to be used.

Why hasn't any developer created a CMS that is flexible enough to fit more requirements. Drupal has come close but it has become too bloated and it's pseudo OOP leaves much to be desired.

I'm looking to start developing a CMS based on some designs I've sketched up. It will work as follows:

- Every piece of content is called a node. A node by itself has no default fields, only creation dates, publishing settings, a searchable index column, and a view counter.

- Nodes are loaded by a NodeLoader class which takes requirements similar to the active-record class in CI for sorting, pagination, and WHERE-clausing. The NodeLoader will return an array of Node objects, discussed below

- The fields a node will have are defined by content-types. A content-type is just an ID that unites a number of fields under a common umbrella as to ensure every node under that content-type will have the same fields (i.e. a blog content type will have a Title and Body field).

- Fields are defined as classes that are modular in nature and implement a number of methods as defined in an interface and inherits a generic Field class. The methods in the interface will include actions to render and display the administration form controls necessary to modify and update this field.

- Node objects will contain the intelligence to load all the Field classes as members of the class using the PHP _get overload method and storing them in a private data array within the class. This means you'll be able to access the various defined fields of a node as follows:

Code:
$Node->Title //will return the Field object while
$Node->Title->display() //will, via the display() method, defined in the interface, output an html version of the field.


- Node objects will also include a save method and will be created using a factory pattern to allow for new nodes to be created with an association to a content-type. This means once you have a node loaded you can simply do something like this to update a field:

Code:
$Node->Title->set($value);
$Node->Save();

- A categorization engine will exist that will allow for flexible categorization of different types of content within one category.

So far here's an example of how you'd use the finished product:
Code:
$NodeFetcher = NodeFetcher::by_content_type(4); // using a factory pattern to create a NodeFetcher keyed by content_type.

$NodeFetcher->page_range(0, 10); // Display the first 10 nodes
$Nodes = $NodeFetcher->get(); //fetch the results


foreach ($Nodes as $Node)
{
//while this next part requires knowledge of the fields associated with the content-type a function could also list these for us so we could loop through them.

$Node->Title->display();

$params = Array('text_length' => '100'); //Pass some parameters to the display function to limit the number of words displayed.
$Node->Body->display($params);

$params = Array('thumb_size' => '200x200', 'cache' => TRUE);
$Node->Image->display($params); //would handle thumbnail generation and the such.
}

In addition to this a flexible template engine will need to be developed (smarty doesn't allow object access with the flexibility I desire) so you can access nodes in an easier method. It'd be nice for the template system to define the URI structure.

This is what I've thought up so far... does this sound like a viable project? I am looking to create a flexible CMS that I can reuse as part of a web-design firm to avoid recreating code and so far non of the open-source solutions have done it.

I'd be willing to open up this project under a limited GPL or something similar if anyone is interested in co-developing it with me.




Theme © iAndrew 2016 - Forum software by © MyBB