2017 © Pedro Peláez
 

symfony-bundle sitemap-bundle

Sitemap generator for Symfony 2 project

image

skuola/sitemap-bundle

Sitemap generator for Symfony 2 project

  • Tuesday, September 6, 2016
  • by skuola
  • Repository
  • 8 Watchers
  • 4 Stars
  • 1,520 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 1 Open issues
  • 14 Versions
  • 10 % Grown

The README.md

SitemapBundle

SensioLabsInsight Build Status, (*1)

Installation

Install the bundle:, (*2)

composer require skuola/sitemap-bundle

Register the bundle in app/AppKernel.php:, (*3)

``` php <?php // app/AppKernel.php public function registerBundles() { return array( // ... new Skuola\SitemapBundle\SkuolaSitemapBundle() ); }, (*4)


##Basic Configuration ``` yml # app/config/config.yml skuola_sitemap: scheme: http host: www.example.com db_driver: orm # orm|mongodb sitemaps: FirstSitemap: index: # If you want to specify a custom base url for sitemap_index base_url: ~ # Or your custom base url: http://%domain%/sitemaps/home path: ~ # %kernel.root_dir%/../web/sitemap_index.xml path: ~ # %kernel.root_dir%/../web/sitemap.xml routes: category_show: options: slug: repository: object: SkuolaTestBundle:Category property: slug method: findPublic type: defaults: ["free", "open-source", "premium"] changefreq: weekly priority: 0.5 open_source_post: options: slug: repository: object: SkuolaTestBundle:Category property: slug method: findBySlug #Call findWithSlug($slug) method with custom arguments arguments: ["open-source"] changefreq: weekly priority: 0.3 tag_show: options: slug: repository: object: SkuolaTestBundle:Tag property: slug type: repository: object: SkuolaTestBundle:Type property: id method: findEnabled #merge repository results with defaults options defaults: [0] changefreq: weekly priority: 0.8

Multi Sitemaps

``` yml skuola_sitemap: scheme: http host: www.example.com db_driver: orm sitemaps: Blog: index: base_url: http://www.example.com/sitemaps/home path: %kernel.root_dir%/../web/shared/sitemaps/home/sitemap_index.xml path: %kernel.root_dir%/../web/shared/sitemaps/home/sitemap.xml routes: ... Store: index: base_url: http://www.example.com/sitemaps/store path: %kernel.root_dir%/../web/shared/sitemaps/store/sitemap_index.xml path: %kernel.root_dir%/../web/shared/sitemaps/store/sitemap.xml routes: ..., (*5)


##Configuration with custom service: ###Example Routing ``` yml # app/config/test_routing.yml page_show: path: /{category_slug}/{page_slug}

Configuration ``` yml, (*6)

app/config/config.yml

skuola_sitemap: scheme: http host: www.example.com db_driver: orm sitemaps: FirstSitemap: routes: page_show: provider: skuola_testbundle.sitemap.page_provider changefreq: weekly priority: 0.5, (*7)


Create your generator service, implements `Skuola\SitemapBundle\Service\ParametersCollectionInterface` ``` yml # src/TestBundle/Resources/config/services.yml services: skuola_testbundle.sitemap.page_provider: class: Skuola\TestBundle\Service\Sitemap\PageProvider arguments: [@doctrine.orm.entity_manager]

Create PageProvider class, (*8)

php use Skuola\SitemapBundle\Service\ParametersCollectionInterface; class PageProvider implements ParametersCollectionInterface { protected $entityManager; public function __construct($entityManager) { $this->entityManager = $entityManager; } //Implement getParametersCollection() public function getParametersCollection() { $collection = []; $pages = $this->entityManager->getRepository('Page')->findAll(); foreach($pages as $page) { $collection[] = [ 'category_slug' => $page->getCategory()->getSlug(), 'page_slug' => $page->getSlug() ] } return $collection; } }, (*9)

Run, (*10)

app/console sitemap:generator, (*11)

Run single Sitemap, (*12)

app/console sitemap:generator --name "FirstSitemap", (*13)

SitemapGeneratorCommand, (*14)

The Versions

06/09 2016

dev-master

9999999-dev

Sitemap generator for Symfony 2 project

  Sources   Download

MIT

The Requires

 

The Development Requires

by Oreste Di Modugno

bundle generator symfony sitemap sitemap generator skuola sitemap bundle

06/09 2016

v1.0.9

1.0.9.0

Sitemap generator for Symfony 2 project

  Sources   Download

MIT

The Requires

 

The Development Requires

by Oreste Di Modugno

bundle generator symfony sitemap sitemap generator skuola sitemap bundle

05/09 2016

v1.0.8

1.0.8.0

Sitemap generator for Symfony 2 project

  Sources   Download

MIT

The Requires

 

The Development Requires

by Oreste Di Modugno

bundle generator symfony sitemap sitemap generator skuola sitemap bundle

17/06 2016

v1.0.7

1.0.7.0

Sitemap generator for Symfony 2 project

  Sources   Download

MIT

The Requires

 

The Development Requires

by Oreste Di Modugno

bundle generator symfony sitemap sitemap generator skuola sitemap bundle

16/06 2016

dev-oreste-dev

dev-oreste-dev

Sitemap generator for Symfony 2 project

  Sources   Download

MIT

The Requires

 

The Development Requires

by Oreste Di Modugno

bundle generator symfony sitemap sitemap generator skuola sitemap bundle

11/01 2016

v1.0.6

1.0.6.0

Sitemap generator for Symfony 2 project

  Sources   Download

MIT

The Requires

 

The Development Requires

by Oreste Di Modugno

bundle generator symfony sitemap sitemap generator skuola sitemap bundle

11/01 2016

dev-max-dev

dev-max-dev

Sitemap generator for Symfony 2 project

  Sources   Download

MIT

The Requires

 

The Development Requires

by Oreste Di Modugno

bundle generator symfony sitemap sitemap generator skuola sitemap bundle

21/12 2015

v1.0.5

1.0.5.0

Sitemap generator for Symfony 2 project

  Sources   Download

MIT

The Requires

 

The Development Requires

by Oreste Di Modugno

bundle generator symfony sitemap sitemap generator skuola sitemap bundle

13/11 2015

v1.0.4

1.0.4.0

Sitemap generator for Symfony 2 project

  Sources   Download

MIT

The Requires

 

The Development Requires

by Oreste Di Modugno

bundle generator symfony sitemap sitemap generator skuola sitemap bundle

11/11 2015

v1.0.3

1.0.3.0

Sitemap generator for Symfony 2 project

  Sources   Download

MIT

The Requires

 

The Development Requires

by Oreste Di Modugno

bundle generator symfony sitemap sitemap generator skuola sitemap bundle

11/11 2015

v1.0.2

1.0.2.0

Sitemap generator for Symfony 2 project

  Sources   Download

MIT

The Requires

 

The Development Requires

by Oreste Di Modugno

bundle generator symfony sitemap sitemap generator skuola sitemap bundle

13/10 2015

dev-travis

dev-travis

Sitemap generator for Symfony 2 project

  Sources   Download

MIT

The Requires

 

The Development Requires

by Oreste Di Modugno

bundle generator symfony sitemap sitemap generator skuola sitemap bundle

13/10 2015

v1.0.1

1.0.1.0

Sitemap generator for Symfony 2 project

  Sources   Download

MIT

The Requires

 

The Development Requires

by Oreste Di Modugno

bundle generator symfony sitemap sitemap generator skuola sitemap bundle

13/10 2015

v1.0

1.0.0.0

Sitemap generator for Symfony 2 project

  Sources   Download

MIT

The Requires

 

The Development Requires

by Oreste Di Modugno

bundle generator symfony sitemap sitemap generator skuola sitemap bundle