PHPackages                             pieceofcake2/sitemap - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. pieceofcake2/sitemap

ActiveCakephp-plugin

pieceofcake2/sitemap
====================

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

v1.0.3(7mo ago)00MITPHPPHP ^8.0CI passing

Since Oct 7Pushed 7mo agoCompare

[ Source](https://github.com/pieceofcake2/sitemap)[ Packagist](https://packagist.org/packages/pieceofcake2/sitemap)[ RSS](/packages/pieceofcake2-sitemap/feed)WikiDiscussions 1.x Synced 1mo ago

READMEChangelogDependencies (7)Versions (2)Used By (0)

CakePHP 2 Sitemap
=================

[](#cakephp-2-sitemap)

[![GitHub License](https://camo.githubusercontent.com/4fad0e04956fbe067498a6ff8dea65d2b7fc1638d89fa2eb777d368e7de770f2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f70696563656f6663616b65322f736974656d61703f6c6162656c3d4c6963656e7365)](LICENSE)[![Packagist Version](https://camo.githubusercontent.com/eb78237c95b0de9e4cbcf4201a4682b8a3f38179ca7e0292352be10f4f1c1d5c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f70696563656f6663616b65322f736974656d61703f6c6162656c3d5061636b6167697374)](https://packagist.org/packages/pieceofcake2/sitemap)[![PHP](https://camo.githubusercontent.com/ba59251992a51fa5ce0bc3a0326709767663aa9f0eb5d3aa7daa4de7b6c93cb5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f70696563656f6663616b65322f736974656d61702f7068703f6c6f676f3d706870266c6f676f436f6c6f723d253233464646464646266c6162656c3d504850266c6162656c436f6c6f723d25323337373742423426636f6c6f723d253233464646464646)](https://camo.githubusercontent.com/ba59251992a51fa5ce0bc3a0326709767663aa9f0eb5d3aa7daa4de7b6c93cb5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f70696563656f6663616b65322f736974656d61702f7068703f6c6f676f3d706870266c6f676f436f6c6f723d253233464646464646266c6162656c3d504850266c6162656c436f6c6f723d25323337373742423426636f6c6f723d253233464646464646)[![CakePHP](https://camo.githubusercontent.com/d30af53b2e37dfa7086037a2b8b7c2b942e55606df07da4b3462eeb8e1f1e045/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f70696563656f6663616b65322f736974656d61702f70696563656f6663616b65322f63616b657068703f6c6f676f3d63616b65706870266c6f676f436f6c6f723d253233464646464646266c6162656c3d43616b65504850266c6162656c436f6c6f723d25323344333343343326636f6c6f723d253233464646464646)](https://camo.githubusercontent.com/d30af53b2e37dfa7086037a2b8b7c2b942e55606df07da4b3462eeb8e1f1e045/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f70696563656f6663616b65322f736974656d61702f70696563656f6663616b65322f63616b657068703f6c6f676f3d63616b65706870266c6f676f436f6c6f723d253233464646464646266c6162656c3d43616b65504850266c6162656c436f6c6f723d25323344333343343326636f6c6f723d253233464646464646)[![CI](https://camo.githubusercontent.com/8252ad6f05eca355d1ffebfd8500c0d122933e9ed2692eb69ac5dc94917ad14d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f70696563656f6663616b65322f736974656d61702f43492e796d6c3f6c6162656c3d4349)](https://github.com/pieceofcake2/sitemap/actions/workflows/CI.yml)[![Codecov](https://camo.githubusercontent.com/a0f3530ac8228b9100f13893e91483c143f03f085adf937b76e0fd3462ee25e0/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f67682f70696563656f6663616b65322f736974656d61703f6c6162656c3d436f766572616765)](https://codecov.io/gh/pieceofcake2/sitemap)

**This is forked for CakePHP2.**

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

Background
----------

[](#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
------------

[](#requirements)

- PHP 8.0+
- CakePHP 2.10+

Installation
------------

[](#installation)

### Composer

[](#composer)

```
$ composer require pieceofcake2/sitemap
```

Usage
-----

[](#usage)

- Add this this line to your `bootstrap.php`:

```
CakePlugin::load(['Sitemap' => ['routes' => true]]);
```

- Add the behavior to the model desired to generate a sitemap for that model

```
public $actsAs = [
    'Sitemap.Sitemap' => [
        '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' => [], // Conditions to limit or control the returned results for the sitemap
    ]
];
```

- Sitemap should now be visible at /sitemap and /sitemap.xml

Contributing
------------

[](#contributing)

### Reporting Issues

[](#reporting-issues)

Please use [GitHub Isuses](https://github.com/pieceofcake2/sitemap/issues) for listing any known defects or issues.

License
-------

[](#license)

[MIT](./LICENSE)

Copyright
---------

[](#copyright)

[Loadsys Web Strategies](https://www.loadsys.com) 2016

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance64

Regular maintenance activity

Popularity0

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

216d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/578548?v=4)[TSURU](/maintainers/ttsuru)[@ttsuru](https://github.com/ttsuru)

---

Top Contributors

[![justinyost](https://avatars.githubusercontent.com/u/85320?v=4)](https://github.com/justinyost "justinyost (42 commits)")[![beporter](https://avatars.githubusercontent.com/u/637270?v=4)](https://github.com/beporter "beporter (1 commits)")[![ttsuru](https://avatars.githubusercontent.com/u/578548?v=4)](https://github.com/ttsuru "ttsuru (1 commits)")

---

Tags

cakephpmodelBehaviorSitemapcakephp2

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/pieceofcake2-sitemap/health.svg)

```
[![Health](https://phpackages.com/badges/pieceofcake2-sitemap/health.svg)](https://phpackages.com/packages/pieceofcake2-sitemap)
```

###  Alternatives

[lorenzo/linkable

CakePHP Linkable Behavior

2753.3k](/packages/lorenzo-linkable)[loadsys/cakephp_sitemap

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

2819.6k](/packages/loadsys-cakephp-sitemap)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
