Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

Commit 9bc4682

Browse files
committed
Merge pull request #683 from symfony-cmf/seo-sitemap-doc
documenting the sitemap features
2 parents 29265c3 + d2708d4 commit 9bc4682

File tree

4 files changed

+395
-0
lines changed

4 files changed

+395
-0
lines changed

bundles/seo/configuration.rst

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,101 @@ manually or disable the content listener.
122122
In versions of the SeoBundle prior to 1.2, the ``content_key`` was
123123
configured directly in the ``cmf_seo`` root.
124124

125+
``sitemap``
126+
~~~~~~~~~~~
127+
128+
.. versionadded:: 1.2
129+
Support for sitemaps was introduced in version 1.2 of the SeoBundle.
130+
131+
.. configuration-block::
132+
133+
.. code-block:: yaml
134+
135+
# app/config/config.yml
136+
cmf_seo:
137+
sitemap:
138+
enabled: true
139+
defaults:
140+
default_change_frequency: always
141+
templates:
142+
html: CmfSeoBundle:Sitemap:index.html.twig
143+
xml: CmfSeoBundle:Sitemap:index.xml.twig
144+
configurations:
145+
sitemap: ~
146+
147+
.. code-block:: xml
148+
149+
<!-- app/config/config.xml -->
150+
<?xml version="1.0" encoding="UTF-8" ?>
151+
<container xmlns="http://symfony.com/schema/dic/services">
152+
153+
<config xmlns="http://example.org/schema/dic/cmf_seo">
154+
<sitemap enabled="true">
155+
<defaults>
156+
<template format="html">CmfSeoBundle:Sitemap:index.html.twig</template>
157+
<template format="xml">CmfSeoBundle:Sitemap:index.xml.twig</template>
158+
</defaults>
159+
<configuration name="sitemap"/>
160+
</sitemap>
161+
</config>
162+
</container>
163+
164+
.. code-block:: php
165+
166+
// app/config/config.php
167+
$container->loadFromExtension('cmf_seo', array(
168+
'sitemap' => array(
169+
'enabled' => true,
170+
'defaults' => array(
171+
'templates' => array(
172+
'html' => 'CmfSeoBundle:Sitemap:index.html.twig',
173+
'xml' => 'CmfSeoBundle:Sitemap:index.xml.twig',
174+
),
175+
),
176+
'configurations' => array(
177+
'sitemap' => null,
178+
),
179+
),
180+
));
181+
182+
``enabled``
183+
"""""""""""
184+
185+
**type**: ``boolean`` **default**: ``false``
186+
187+
Whether or not the :doc:`sitemap` should be loaded. As soon as you configure
188+
anything else in the ``sitemap`` section, this defaults to true.
189+
190+
``defaults``
191+
""""""""""""
192+
193+
Contains default configuration that applies to all sitemaps.
194+
195+
``configurations``
196+
""""""""""""""""""
197+
198+
Contains the list of sitemaps that should exist. Each sitemap can overwrite
199+
default configuration. If not specified, a sitemap called "sitemap" exists.
200+
201+
``default_change_frequency``
202+
****************************
203+
204+
**type**: ``enum`` **default**: ``always`` **allowed values**: 'always', 'hourly', 'daily', 'weekly', 'monthly', 'yearly', 'never'
205+
206+
Specify the change frequency for UrlInformation that do not have one explicitly
207+
set.
208+
209+
``templates``
210+
*************
211+
212+
**type**: ``hashmap`` **default**: templates for html and xml
213+
214+
This hashmap specifies which template to use for the sitemap in each format.
215+
By default, you have:
216+
217+
* html: CmfSeoBundle:Sitemap:index.html.twig
218+
* xml: CmfSeoBundle:Sitemap:index.xml.twig
219+
125220
``sonata_admin_extension``
126221
~~~~~~~~~~~~~~~~~~~~~~~~~~
127222

bundles/seo/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ SeoBundle
77
introduction
88
seo_aware
99
extractors
10+
sitemap
1011
configuration

0 commit comments

Comments
 (0)