MANUAL

All the doumentation of this web site is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Unported License

Install sfW3studioCmsPlugin

System configuration

W3studioCMS is an application that runs through a webserver. It has been developed using the php scripting language under an apache webserver and uses mysql as database. This configuration is commonly called AMP, which means, Apache, Mysql, Php and becomes LAMP when runs under Linux or WAMP when runs under Windows.

To use this CMS you must have a system configured with an AMP system. If you don't have any idea on how to start, simply download the system sandbox which installs a full configured WAMP system.

Additional configuration

You must configure your apache server with the module_rewrite module enabled, to run properly the CMS. Refer to symfony's book to learn how to configure the webserver.

Vendor required packages

The CMS has been developed using the symfony's framework, so you have to install symfony 1.2.x to run the cms or you can use the sandbox version which comes with a pre-installed version of the framework

Installing a fresh copy of the CMS

Create a new folder called myAwesomeProject under your web server, enter that folder with your console and init a new project, as follows:

php symfony generate:project myAwesomeProject

Init an applicaion, as follows:

php symfony generate:app myAwesomeProject

Install the sfGuardPlugin, as follows:

From pear: symfony plugin:install sfGuardPlugin-3.1.3.gz

Or, simply download the package and decompress it into your project's plugin folder. Pay attention to download the latest stable version for 1.2.x symfony framework.

Install the dbFinderPlugin, as follows:

From pear: symfony plugin:install dbFinderPlugin

Or, simply download the package and decompress it into your project's plugin folder.

Install the sfW3studioCmsPlugin, as follows:

php symfony plugin:install sfW3studioCmsPlugin-1.1.0.tgz

You can install it directly from the zip/tar file, simply coping the sfW3studioCmsPlugin into the plugins directory of your project.

W3StudioCMS uses tinyMce as default editor to manage texts, so you have to install it by coping it under the js folder, placed under the web dir of your project. Pay attention that with firefox 3 is required the version 3.2 of tinyMce and the 2.0.1 version of the compressor distributed with that tool.

Next steps has been automatized by the w3sWidgetInstallPlugin, which can be downloaded from the w3studiocms web site. If you prefer to install it manually, or you want to know deeply how the cms works, continue reading.

Enviroment configuration

Create a new folder under the data directory and call it published. This folder will contain the published files which are browsed by the users of your website.

Create a new folder under the main root directory of your project and call it themes. This folder will contain the themes you will use in your website.

W3StudioCMS requires you to add the code below to the projectConfiguration.class.php's setup method:

require_once(sfConfig::get('sf_plugins_dir').'/sfW3studioCmsPlugin/lib/config/sfW3studioCmsPluginConfiguration.class.php');
sfW3studioCmsPluginConfiguration::enableBundledPlugins($this);

In a new project the full code of projectConfiguration.class.php is as follows:

public function setup()
{
  require_once(sfConfig::get('sf_plugins_dir').'/sfW3studioCmsPlugin/lib/config/sfW3studioCmsPluginConfiguration.class.php');
  sfW3studioCmsPluginConfiguration::enableBundledPlugins($this);

  // for compatibility / remove and enable only the plugins you want
  $this->enableAllPluginsExcept(array('sfDoctrinePlugin', 'sfCompat10Plugin'));
}

W3studioCMS has an internal system of plugins to manage the CMS' interface. One plugin for W3studioCMS has the same structure of a symfony's plugin, this will semplify the way to write a plugin and extend the CMS to fit your needs.

Predefined theme

You can add the predefined theme, bundled with W3studioCMS, following these steps:

Copy the w3sW3studio2009Theme from the data/themes folder under the themes folder just created and, from the same folder, copy the images into the standardThemeImage under /web/uploads/assets.

Database configuration

Create a new database and call it w3studiocms. The db name is not important, so you can choose another name, but in the configuration samples below, that name is used so if you want to use another name, change the dbname parameter's value with the one you choose. Configure the propel.ini file to access to your database, as follows:

[...]
propel.database.url = mysql:dbname=w3studiocms;host=localhost
propel.database.creole.url = ${propel.database.url}
propel.database.user       = [your username]
propel.database.password   = [your password]
[...]

Configure the database.yml file to access the database, as follows:

all:
  propel:
    class:        sfPropelDatabase
    param:
      classname:  PropelPDO
      dsn:        mysql:dbname=w3studiocms;host=localhost
      username:   [your username]
      password:   [your password]
      encoding:   utf8
      persistent: true
      pooling:    true

Open a new console, move to the project folder and run the commands below.

First of all you haver to clear the cache to load the new settings you made into the database.yml file, so run:

    php symfony cc

Now you have to build the model and create the database from the schema.yml file provided with the CMS.

    php symfony propel:build-all

If you choose to use the standard theme bundled with the cms, run:

    symfony propel:data-load

Now you have to publish the assets for both the symfony's plugins and the W3studioCMS' plugins.

    symfony plugin:publish-assets

Now you have to publish the assets for the W3studioCMS' themes, using the W3studioCMS' task publish-assets. This task works exactly as the symfony's publish-assets, but for themes. It copies or symlinks the themes' web folder to the project's web folder.

    symfony w3s-themes:publish-assets

Clear the cache and you're done.

    symfony cc

The installation plugin

As you notice, there are many operations to setup the W3studioCMS. To help you in this operation you can use the w3sExtensionInstallPlugin, which is nopt bundled with the plugin's package but it can be downloaded from the w3studiocms website. This plugin implements several tasks to configure the CMS from the command line and provides a web interface which can be used instead the task in enviroments where the console cannot be used.

Setup with a custom theme

When you become familiar with the CMS, probably you would not use the default theme anymore, but you prefer to use a custom theme for your web site. You need an empty project to do this operation. You can use the sandbox provided on w3studiocms website or starting a new project with the required plugins by W3StudioCMS.

In above cases, you have to onfigure the databases.yml and propel.ini files as explained above. The first thing to do is to install W3studioCMS:

    php symfony propel:build-all
    symfony plugin:publish-assets
    symfony cc

To use your own theme, create a new themes folder under the project root, then copy it inside the themes folder. Now you are ready to run the w3s-initialize task, which configures the theme, language, group and inserts a page. You can specify several options to customize the initialization process: you can set the name of the template to use for the creation of the group, the name that has to be assigned the new group and the name that has to be assigned the new page. If you don't specify a template, the first one is used.

Rendering filter

Since 1.1.5 release a change is needed for the filters.yml configuration file, placed under the config folder of the application that uses w3studiocms, usually located at /apps/[your app name]/config and add the following code under the common section

w3sRendering:
  class: w3sRenderingFilter   # Filter class
  param:                     # Filter parameters
    type: rendering

Your filters.yml file should appear as follows:

rendering: ~
security:  ~

# insert your own filters here

cache:     ~
common:    ~

w3sRendering:
  class: w3sRenderingFilter   # Filter class
  param:                     # Filter parameters
    type: rendering

execution: ~

Run the CMS

Open a browser. W3studiocms has been developed using Mozilla Firefox and has not been fully tested with Internet Explorer, so I suggest to use Firefox to work with this CMS.

W3studioCMS comes with a predefinited template but you can easy change it with another one made by yourself. Clik the Edit site button and enter admin as username and admin as password.