i18n ready (the interface is translated / french translation included)

Can be used in any kind of module (by extending it or not), any kind of project.

The aim is to give a backend admin to navigation and content management for all kind of Symfony Project. Then plugin usage is quite more complex and quite different that sfSimpleCMS but permits to be used in any kind of project.

This CMS is not l10n, you can't have different versions for a page. But you can maintain different versions for a whole website. Then websites can be totaly different according to their culture and managed separately.

This CMS is currently used by all websites (15+) developped by the author : mainly e-commerce and corporate websites.

Developers

License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

i18n ready (the interface is translated / french translation included)

Can be used in any kind of module (by extending it or not).

The aim is to give a backend admin to navigation and content management for all kind of Symfony Project. Then plugin usage is quite more complex and quite different that sfSimpleCMS but permits to be used in any kind of project.

This CMS is not l10n, you can't have different versions for a page. But you can maintain different versions for a whole website. Then websites can be different according to their culture.

This CMS is currently used by all websites (10) developped by the author : mainly e-commerce and corporate websites.

Alternatively, if you don't have PEAR installed, you can download the latest package attached to this plugin's wiki page and extract it under your project's plugins/ directory. You will also have to copy the contents of the myproject/plugins/sfDynamicCMSPlugin/web/ directory into a myproject/web/sfDynamicCMSPlugin/ directory.

Rebuild the model, generate the SQL code for the new tables and insert it into your database:

$ php symfony propel-build-all

Enable the new sfDynamicCMS modules in frontend via the settings.yml file.

Clear all routes in routing.yml of frontend. It is possible to add your specific routes (first test without) but it is not advised to have routes which use :module parameter (except if you have well understand sfDynamicCMS routing system).

generally, you will want to insert your own filters here

sfDynamicCMS:
class: sfDynamicCMSFilter

cache:
common:
flash:
execution:

Clear the cache to enable the autoloading to find the new classes:

$ php symfony cc

sfDynamicCMSAdmin Configuration

sfDynamicCMSAdmin configuration require mainly to describe slots. The aim is to have a syntax which look like "Admin generator" generator.yml files for slots description.
Usually configuration is also used to describe global templates which are used by all version. It is possible in admin to define templates that are used only in a specific version.

Templates & nodes system are based on sfPropelSlotBehavior plugin so configuration works in the same way than this plugin.

Next : If you want to use all the power of sfDynamicCMS you should extend one or many modules with sfDynamicCMS module.

What are slots ?

sfDynamicPlugin's slots not have anything to do with Symfony's slots using in view.
Slots are the content logic of pages like fields are the content logic of your database table, so sfDynamicPlugin's slots describe content part of a page like : title, text, picture, link, etc. It can be also, parameters for a page like : show_title, number_column, news_attached_to...

Then each page templates are composed of slots. Then template without slots content only static content.
Each slots have a type, it can be : text, rich text (using tiny_mce), date, file, checkbox, selectbox, list selection, etc.

Slots description are attached to templates and slots content are attached to pages.

Templates you design might use method to retrieve the slot content like :

It is recommanded (but optionnal) to add the SfDynamicCMS features to all module actions by adding this 2 lines in preExecute method.
You can also add this 2 lines only in actions which need SfDynamicCMS features.

first line concern navigation : it just return the current element in navigation tree (if sfDynamicCMS is able to find it).

second line concern page, template and content : it return the current page linked to the navigation element
Moreother, this feature automaticaly define page title, page meta-tags and page template.

Template files

Usually, the template file used is named with the name of the template and the suffix "Success" like my_templateSuccess.php.
But if a template file named with the name of action and the suffix "Success" exist like indexSuccess.php, it will overide this.
It permits to use page content (structured with a generic template slots) with a specific template defined for a specific action.

Then be carefull, indexSuccess.php will overide your template file if you use index action which is usualy the default action (this may change for a future version).

getFirstInternalUri() method

This method is used in link_to_node helper and every helper using it (like sfDynamicCMSMenu).

getFirstInternalUri() method try to get the first uri to node containing a page by browsing down the tree. If no node containing a page is found, it return uri to the current node.

Example 1 :
If you have a node which is only a section's title (no content) named "activities" containing several pages like "e-commerce", "intranet", etc.
A call to getFirstInternalUri() on "activities" node will return a symfony uri on "activities/e-commerce" because activities have no content and is only a section title.

Example 2 :
If you have a node which use custom routing to use your own module like "product catalog" and then has no page assigned to.
This node has no child.
A call to getFirstInternalUri() on this node will return a symfony uri to "product".

Then the aim is to have a main menu on your website with different type of link : link to a page, link to a section, link to your own module.
You should used getFirstInternalUri() method to retrieve symfony uri on menu elements to retrieve Symfony uri to the web pages associated to.

sfDynamicCMS Routing & URL

In opposition to Symfony routing system, sfDynamic navigation is organize in a hierarchy. So route rules are organize in a tree and URL can be relative which is impossible with routing.yml rules.

The aim is to have a tree managed navigation which permit :

CMS pages with automated route & url management system. The you can give to your client the ability to manage their website easily like in every CMS : they don't care about url or route (and they don't have access to it).

Dynamic pages (like a product catalog) using the url, the extension, the module, the action and the parameters you want for a given element (like in Symfony) to not loose Symfony flexibility and had business logic. By this way, your own-design modules can use sfDynamicCMS features.

So it is possible to combine cms advantages and simplicity for your client with your custom-built modules which use all the powerfull features offered by Symfony and sfDynamicCMS.

URL

Root element url might be "/" or "/my_cms"

Children element url can be relative or absolute (but on first level it is the same because route url is "/").
Absolute url start with a "/" and relative url doesn't. It is also possible to have default url which is a relative url generated automaticaly with menu name (stripped menu name) and hard url (to be used in menu generation) starting with http://.

Then there is 4 kinds of url :

default url generated automaticaly (leave the url field empty)

relative url : a word (eg: "about-the-company" or "company/team") which will be concateneted with parent url to generate the final url

absolute url : an url starting with a "/" (eg: "/my-custom-url") which don't care of parent element, url is what you want.

Url can have like in routing.yml rules : "" character or parameters (eg: "books/:book_id/") but you might have to use custom routing in this case.

Route

After defining the way to call the page, "the url", you have to define how it reacts. Then sfDynamicCMS permits 3 ways to define a route :

Default routing : route managed automaticaly by sfDynamicCMS

Custom routing : route managed by sfDynamicCMS, same routing parameters that routing.yml can be defined, you have the advantage to have a tree routing feature and route recognize by the CMS.

Traditionnal routing : routing rules defined in routing.yml of the application. Not recommanded but possible.

Custom routing

By using Custom routing, sfDynamicCMSAdmin module generate rules in routing.yml (without erasing your own rules).
sfDynamicCMS will recognize this kind of rules. This way is usefull to merge your business logic with cms features offered by sfDynamicCMS.

Default routing

By using Default way, there is nothing to define, route is managed automaticaly but not permit to have use a specific module or action.
Default routing doesn't appear in routing.yml, this rules are executed after custom and traditionnal routing rules.

Traditionnal routing

Traditionnal rules can defined in routing.yml before or after the sfDynamicCMS rules (which are automaticaly updated).
Be carefull because sfDynamicCMS might not be able to find where are located this rules in sfDynamicCMS navigation tree.

Changes:
* in frontend app.yml, for slots & templates description : you should rename "name" to "title"
* Be careful Node's isVisible() and getVisibleChildren() methods might be used instead of isPublished() and getPublishedChildren() method for menu(s)