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

Commit e7b45f3

Browse files
committed
Add MenuContentVoter
1 parent 9217365 commit e7b45f3

File tree

3 files changed

+46
-0
lines changed

3 files changed

+46
-0
lines changed

bundles/menu/menu_documents.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,4 +114,7 @@ The standard menu node implements ``PublishTimePeriodInterface`` and
114114
``PublishableInterface``. Please refer to the
115115
:doc:`publish workflow documentation <../core/publish_workflow>`.
116116

117+
The CmfMenuBundle has a `MenuContentVoter`, this voter decides that a menu node
118+
is not published if the content it is pointing to is not published.
119+
117120
.. _`Creating Menus: The Basics`: https://github.com/KnpLabs/KnpMenu/blob/1.1.x/doc/01-Basic-Menus.markdown

bundles/menu/menu_factory.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,6 @@ Publish Workflow
5959
The CMF menu factory also determines if menu nodes are published and therefore
6060
visible by use of the :doc:`publish workflow checker
6161
<../core/publish_workflow>`.
62+
63+
The CmfMenuBundle has a `MenuContentVoter`, this voter decides that a menu node
64+
is not published if the content it is pointing to is not published.

reference/configuration/menu.rst

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,3 +232,43 @@ uri_prefix
232232
**type**: ``boolean``
233233

234234
Enable the :ref:`bundles_menu_voters_uri_prefix_voter`.
235+
236+
publish_workflow
237+
~~~~~~~~~~~~~~~~
238+
239+
This configures if the menu content voter for the publish workflow should be
240+
disabled, by default it is enabled if the :doc:`CoreBundle <../../bundles/core/index>`
241+
is registered, and the ``cmf_core.publish_workflow`` is enabled.
242+
243+
For more information refer to the
244+
:doc:`publish workflow documentation <../../bundles/core/publish_workflow>`.
245+
246+
To disable the menu content voter, use:
247+
248+
.. configuration-block::
249+
250+
.. code-block:: yaml
251+
252+
cmf_menu:
253+
publish_workflow:
254+
enabled: false
255+
256+
.. code-block:: xml
257+
258+
<?xml version="1.0" charset="UTF-8" ?>
259+
<container xmlns="http://symfony.com/schema/dic/services">
260+
261+
<config xmlns="http://cmf.symfony.com/schema/dic/menu">
262+
<publish-workflow
263+
enabled="false"
264+
/>
265+
</config>
266+
</container>
267+
268+
.. code-block:: php
269+
270+
$container->loadFromExtension('cmf_menu', array(
271+
'publish_workflow' => array(
272+
'enabled' => false,
273+
),
274+
));

0 commit comments

Comments
 (0)