Giter Site home page Giter Site logo

cakephp-sitemap's Introduction

CakePHP-Sitemap

A CakePHP Plugin for adding automatic XML and HTML Sitemaps to an CakePHP app

Latest Version Software License Total Downloads

Background

  • Only generates a sitemap currently for models in the core App, not in Plugins.
  • Generates an HTML list using a dl list.
  • Generates an sitemap.xml file as well.
  • View caching used for the HTML files.
  • Allows for setting a custom callback function to build urls.

Requirements

  • PHP 5.3+
  • CakePHP 2.1+

Installation

Composer

$ composer require loadsys/cakephp_sitemap:~1.0

Usage

  • Add this this line to your bootstrap.php:
CakePlugin::load(array('Sitemap' => array('routes' => true, 'bootstrap' => true)));
  • Add the behavior to the model desired to generate a sitemap for that model
public $actsAs = array(
	'Sitemap.Sitemap' => array(
		'primaryKey' => 'id', // Default primary key field
		'loc' => 'buildUrl', // Default function called that builds a url, passes parameters (Model $Model, $primaryKey)
		'lastmod' => 'modified', // Default last modified field, can be set to FALSE if no field for this
		'changefreq' => 'daily', // Default change frequency applied to all model items of this type, can be set to FALSE to pass no value
		'priority' => '0.9', // Default priority applied to all model items of this type, can be set to FALSE to pass no value
		'conditions' => array(), // Conditions to limit or control the returned results for the sitemap
	)
);
  • Sitemap should now be visible at /sitemap and /sitemap.xml

Contributing

Reporting Issues

Please use GitHub Isuses for listing any known defects or issues.

License

MIT

Copyright

Loadsys Web Strategies 2015

cakephp-sitemap's People

Contributors

justinyost avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.