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

Commit 77f8e68

Browse files
committed
Merge pull request #711 from symfony-cmf/tweak-seo-listener-doc
tweak seo bundle content listener documentation
2 parents cb68ed6 + 844da2c commit 77f8e68

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

bundles/seo/introduction.rst

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,18 +124,19 @@ The ContentListener
124124
~~~~~~~~~~~~~~~~~~~
125125

126126
The ``Symfony\Cmf\Bundle\SeoBundle\EventListener\ContentListener`` looks for a
127-
content document in the request attributes. If it finds a document that is
128-
suitable for extracting metadata, the listener calls
129-
``SeoPresentationInterface::updateSeoPage`` to populate the metadata
130-
information.
127+
content document in the request attributes. If the listener finds a document,
128+
it calls ``SeoPresentationInterface::updateSeoPage`` to populate the metadata
129+
information if possible.
131130

132131
If the :doc:`RoutingBundle <../routing/introduction>` is installed, the default
133132
attribute name is defined by the constant ``DynamicRouter::CONTENT_KEY``. When
134133
not using the RoutingBundle, you need to disable the listener or configure a
135134
key in ``cmf_seo.content_key``.
136135

137-
You may also want to disable this listener when implementing your own mechanism
138-
to extract SEO information.
136+
If you need different behavior, build your own mechanism to extract the SEO
137+
information and disable this listener at ``cmf_seo.content_listener.enabled``
138+
to avoid duplicated work. Things that happen on every request are expensive in
139+
terms of application performance.
139140

140141
The Twig Extension
141142
~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)