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.

Dependencies

Note: The plugin does not use any ORM specific abilities and uses DbFinder for all data retrieval, so it should be able to work with sfDoctrinePlugin and sfDoctrineGuardPlugin with some minor modifications.

Installation

To install the plugin for a symfony project, the usual process is to use the symfony command line:

$ php symfony plugin:install sfBlogsPlugin

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

Enable the plugin in the project's configuration. Note that the admin interface requires the sfCompat10Plugin to be enabled, too.

Configuration

The app.yml file

The plugin is highly configurable and should be easy to integrate to an existing project. Here is the default plugin configuration, taken from myproject/plugins/sfBlogsPlugin/config/app.yml.sample:

all:
sfBlogs:
sidebar: [custom, recent_posts, tags, feeds, blogroll, meta]
copyright: Blogs hosted in this site have various copyright rules. Please refer to the page footer of each post for copyright.
blogroll:
- { title: how is life on earth?, url: 'http://www.howislifeonearth.com' }
- { title: google, url: 'http://www.google.com' }
user_class: sfGuardUser # class name for the user class
use_ajax: true # enable posting of comments in Ajax
use_feeds: true # enable feeds (require sfFeed2Plugin)
use_date_in_url: false # enable to use urls in the form of /year/month/day/title (set to 'false' for backwards compatibility)
post_max_per_page: 5 # number of posts displayed in a list of posts
post_recent: 5 # number of posts to display in the recent sidebar widget
comment_enabled: on # enable comments by default on new posts
comment_disable_after: 0 # number of days after which comments on a post are not possible anymore
# set to 0 for unlimited comments
comment_mail_alert: on # send an email to the blog owner when a comment is posted.
# Possible values are:
# on: send an email for every posted comment
# moderated: send an email for every automoderated comment
feed_count: 5 # number of posts appearing in the RSS feed

You can customize these settings in myproject/apps/myapp/config/app.yml

The sidebar array controls which widgets, and in which order, appear in the sidebar of the blog frontend. The existing widgets are:

custom: insertion of custom HTML code taken from the blog_custom parameter

recent_posts: list of recent posts

archives: post archive by month

tags: list of tags

feeds: links to the RSS and Atom feeds

blogroll: list of blogs

meta: not much for now (link to administration modules, but the link works only if the modules are in the same application)

Routing

The plugin has its own routing roules for the frontend, with a heavy use of DbFinder routes. You can customize them in your routing.yml. Here is the default frontend routing configuration: