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.

It is not aimed at replacing full-featured CMS packages, but offers a lightweight alternative for when you build a website that has to contain pages often updated by special users. It is voluntarily simple, and very easy to configure; so it should fulfill most basic CMS requirements.

Please note that this plugin is in active development. If you want to help and improve it, please contact FranÃ§ois Zaninotto.

Screenshots

Requirements

The prerequisites for using the sfSimpleCMS plugin are:

As the plugin doesn't contain a user management module, the project where you install it must have a table managing authors, or users (whatever the name), and the related Propel class must have a __toString() method. Both these conditions are satisfied by the sfFeed2Plugin, so installing this plugin is a good choice.

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/sfSimpleCMSPlugin/web/ directory into a myproject/web/sfSimpleCMSPlugin/ directory.

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

$ php symfony propel-build-all

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

$ php symfony cc

You can load the included fixtures to start using the forum with test data.

Start using the plugin by browsing to the admin module's default page:

http://myproject/frontend_dev.php/sfSimpleCMSAdmin

There, you will be able to create the root page (if you didn't insert the fixtures) and add new pages. You will also be able to access the new pages in edit mode from the admin section.

Basic usage

Pages created by the sfSimpleCMSPlugin all have a path property. Using this path, you will be able to see the page in the frontend. For instance, if a page is created with the path foo/bar, you will be able to see it by browsing to:

http://myproject/frontend_dev.php/cms/foo/bar

Only published pages are accessible that way.

To edit it, just add a ?edit=true query string to this URL. If the current user has the proper credentials, he will then get access to the edit features:

http://myproject/frontend_dev.php/cms/foo/bar?edit=true

In this mode, all the editable zones of a page can be modified by double-clicking in the zone and changing the content in the form control that appears. Even unpublished pages can be edited that way.

Once the page is edited, you can preview the result by adding preview=true to the query string:

http://myproject/frontend_dev.php/cms/foo/bar?edit=true&preview=true

The editor toolbox will automate all that and, in practice, you will never need to edit the URL.

Configuration

app.yml

Some of the features of the plugin can be altered by configuration. To do so, add some of the following lines to your application's app.yml:

all:
sfSimpleCMS:
default_text: '[text here](add)' # Default text for page editable parts
routes_register: on # Use the plugin's routes
rich_editing: off # Use TinyMCE for rich text editing
default_page: home # Slug (=path) of the default root page
home_link: My swell site # what is displayed on the top right corner of the pages (can be HTML code)
use_l10n: false # Enable multiple versions for a single page
localizations: [fr, es](en,) # If l10n is enabled, list of cultures in which pages are available
default_culture: en # If l10n is not enabled, default culture for pages
editor_credential: # Name of the credential required for page editing (leave blank for free editing)
publisher_credential: # Name of the credential required for page publishing (leave blank for free publishing)
templates: # Available templates
simplePage: Simple Page # the key is the name of a template which must be present in modules/sfSimpleCMS/templates/
home: Home # the value is the name under which the template is presented in lists
slot_types: # Available slot types
Text: Simple text
RichText: Rich text
Php: PHP code
Image: Image
Modular: List of components

If you want to use your own routes instead, turn the routes_register parameter to off in the app.yml.

Templates

The plugin is bundled with a few basic templates, but you will definitely need to add your own templates.

CMS templates are files located under the sfSimpleCMS module's templates/ directory, with a name ending with Template.php. A template must include the sfSimpleCMS helper group and call the include_editor_tools() helper at the bottom.

sf_simple_cms_slot($slot_name, $default text): includes the slot if in view mode, or the editable version of the slot if in edit mode.

The possible values for the slot name are currently limited to: Title, Slot1, Slot2, Slot3, Slot4.

Look and Feel

The sfSimpleForum module comes with a default stylesheet. You can choose to use your own stylesheet instead of the default one. To do so, you must create an empty sfSimpleCMS module inside your application with just one config/view.yml file in it, with the followin content: