PHPackages                             larapulse/sitemap-bundle - 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. larapulse/sitemap-bundle

ActiveSymfony-bundle

larapulse/sitemap-bundle
========================

Provides a way to generate a sitemap as well as for static and dynamic routes, which require Propel, Doctrine, etc.

v1.0.1(8y ago)139MITPHPPHP &gt;=7.0

Since Nov 23Pushed 8y ago2 watchersCompare

[ Source](https://github.com/larapulse/sitemap-bundle)[ Packagist](https://packagist.org/packages/larapulse/sitemap-bundle)[ RSS](/packages/larapulse-sitemap-bundle/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (2)Dependencies (8)Versions (3)Used By (0)

SitemapBundle
=============

[](#sitemapbundle)

[![Latest Version on Packagist](https://camo.githubusercontent.com/7de1cc1ea8f31fff7c58c2d86ec362dbfcb7046f6ee1221b4dce5990c757d873/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c61726170756c73652f736974656d61702d62756e646c652e7376673f7374796c653d666c6174)](https://packagist.org/packages/larapulse/sitemap-bundle)[![Software License](https://camo.githubusercontent.com/f251623e510f5909f16ae3f4e6e548dac11340b9fde1a99be26b015b39272c00/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c6174)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/548a62684e67f0fdd175439686c0b5f1ec7f07fe82aef645e05e3a1f649c5478/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6c61726170756c73652f736974656d61702d62756e646c652f6d61737465722e7376673f7374796c653d666c6174)](https://travis-ci.org/larapulse/sitemap-bundle)[![SensioLabs Insight](https://camo.githubusercontent.com/850b94e511bdc6cd24d43d8ddc1471294acba5aaa7727e6c3f2a5da38e3bd426/68747470733a2f2f696d672e736869656c64732e696f2f73656e73696f6c6162732f692f31646331633064302d623237642d343438312d613735312d3066616433313136383262372e7376673f7374796c653d666c6174)](https://insight.sensiolabs.com/projects/1dc1c0d0-b27d-4481-a751-0fad311682b7)[![SensioLabsInsight](https://camo.githubusercontent.com/272a4aac23f070bbbee39adb22459df6f3956ca79e34bd1423d54c756149249e/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f31646331633064302d623237642d343438312d613735312d3066616433313136383262372f6d696e692e706e67)](https://insight.sensiolabs.com/projects/1dc1c0d0-b27d-4481-a751-0fad311682b7)[![Coverage Status](https://camo.githubusercontent.com/460ee53495c7d5c14168844d45b4a90eaf5795cfd272cbbd3ac1c3a7c2f9c634/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f6c61726170756c73652f736974656d61702d62756e646c652e7376673f7374796c653d666c6174)](https://scrutinizer-ci.com/g/larapulse/sitemap-bundle/code-structure)[![Quality Score](https://camo.githubusercontent.com/974cbd1fc80d2e8d3488eeb59808e46c888a98a977bdb8c35ecd73f3fbbaec82/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6c61726170756c73652f736974656d61702d62756e646c652e7376673f7374796c653d666c6174)](https://scrutinizer-ci.com/g/larapulse/sitemap-bundle)

This Bundle provides a way to create a xml sitemap using any source you want (Doctrine, Propel, MongoDB, Faker, etc.).

This bundle aims to generate standards compliant sitemaps. For more information about sitemaps go to [sitemaps.org](http://www.sitemaps.org/).

The sitemap generation part is handled by the [SitemapGenerator](https://github.com/sitemap-php/SitemapGenerator)library, this bundle eases its integration into a Symfony2 application.

Main features
-------------

[](#main-features)

- static sitemap generation
- dynamic sitemap generation
- sitemap index generation
- memory efficient
- datasource independent
- support for media content (currently images and videos)

---

Install
-------

[](#install)

Via Composer

```
$ composer require larapulse/sitemap-bundle
```

Register the `SitemapBundle` in `app/AppKernel.php`:

```
# app/AppKernel.php
public function registerBundles()
{
    $bundles = [
        // ...
        new Larapulse\SitemapBundle\LarapulseSitemapBundle(),
    ];
}
```

---

Configuration
-------------

[](#configuration)

Add the following options to `app/config/config.yml` file:

```
larapulse_sitemap:
    base_host:         http://www.foo.com
    base_host_sitemap: http://www.foo.com
    limit:             50000
```

**Note:**

- The `base_host` will be prepended to relative urls added to the sitemap.
- The `base_host_sitemap` will be prepended to the sitemap filename (used for sitemap index)
- The `limit` is the number of url allowed in the same sitemap, if defined it will create a sitemap index

#### Routing

[](#routing)

If you don't want to use the console to generate the sitemap, import the routes:

```
larapulse_sitemap:
    resource: "@LarapulseSitemapBundle/Resources/config/routing.yml"
```

This will make the sitemap available from the `/sitemap.xml` URL.

---

Usage
-----

[](#usage)

Add this line `/web/sitemap.xml*` to your `.gitignore` to prevent tracking `sitemap.xml` files by version control system.

### Providers

[](#providers)

In order to support any kind of datasource, the sitemap uses providers to fetch the data.

Exemple provider:

```
