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.

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

http://myproject/frontend_dev.php/gsitemap

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/sfSimpleGoogleSitemapPlugin/config/app.yml.sample:

Note: the provided sample is for serving sitemap for sfSimpleBlogPlugin.

all:
sfSimpleGoogleSitemap:
urls: # define multiple static urls here
homepage: # just a name
url: http://yoursite.com # full URL, e.g.: with http:// prefix
freq: daily # must be either: always, hourly, daily, weekly, monthly, yearly, never
priority: 1.0 # 1.0 is top priority (100%) compared to 0.2 which is less priority (20%)
models: # define multiple models to generate sitemap from
sfSimpleBlogPost: # name of model class
module: sfSimpleBlog # name of module for the url to make up the url
action: show # name of action for the url to make up the url
params: # parameters for the url
stripped_title: getStrippedTitle # name : method to get the parameter value
date: getCreatedAt # method to get date last updated for the url
criteria: # criterias to filter the records to include in the sitemap
is_published: 1 # column_name : value
freq: daily # must be either: always, hourly, daily, weekly, monthly, yearly, never
priority: 0.2 # 1.0 is top priority (100%) compared to 0.2 which is less priority (20%)

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

TODO

Make it write to a physical sitemap.xml file instead of generating it on the fly

Add option to serve compressed sitemap, for large website?

Support more complex criteria (perhaps even make another plugin that parses yml criteria?)