@@ -26,9 +26,17 @@ A menu item should have a URL associated with it. The CMF provides the
2626 from the ``content `` and ``routeParameters `` options when using the
2727 :ref: `dynamic router <bundles-routing-dynamic-generator >`.
2828
29- The ``content `` option, if specified, must contain a class which implements
30- the ``RouteReferrersInterface ``, see the :ref: `dynamic router
31- <bundles-routing-dynamic-generator>` documentation for more information.
29+ The ``content `` option, if specified, must contain something that the content
30+ URL generator can work with. When using the :ref: `dynamic router
31+ <bundles-routing-dynamic-generator>`, this needs to be a class implementing
32+ the ``RouteReferrersInterface ``. You can alternatively specify a custom
33+ ``UrlGeneratorInterface `` with the ``content_url_generator `` configuration
34+ option.
35+
36+ .. versionadded :: 1.2
37+ The ``content_url_generator `` option was introduced in CmfMenuBundle 1.2.0.
38+ Prior to 1.2, the default service ``router `` was hardcoded to generate URLs
39+ from content.
3240
3341URL generation is absolute or relative, depending on the boolean value of the
3442``routeAbsolute `` option.
@@ -44,14 +52,24 @@ of the three URL generation techniques to use.
4452The values for this options can be one of the following:
4553
4654* ``null ``: If the value is ``null `` (or the options is not set) then the link
47- type is determined automatically by looking at each of the ``uri ``, ``route `` and
48- ``content `` options and using the first one which is non-null.
55+ type is determined automatically by looking at each of the ``uri ``, ``route ``
56+ and ``content `` options and using the first one which is non-null.
4957* **uri **: Use the URI provided by the ``uri `` option.
5058* **route **: Generate a URL using the route named by the ``route `` option
5159 and the parameters provided by the ``routeParameters `` option.
52- * **content **: Generate a URL by passing the ``RouteReferrersInterface ``
53- instance provided by the ``content `` option to the router using any
54- parameters provided by the ``routeParameters `` option.
60+ * **content **: Generate a URL by passing the value of the ``content `` option to
61+ the content URL generator, using any parameters provided by the
62+ ``routeParameters `` option.
63+
64+ Menu Nodes without URL
65+ ~~~~~~~~~~~~~~~~~~~~~~
66+
67+ A menu node document might not have a URL, when that information was never set
68+ or it points to a content that has been deleted meanwhile. In that case, there
69+ are two options: The menu node can be skipped, or it can be rendered as text
70+ without link. By default, the node is skipped.
71+
72+ You can set ``cmf_menu.allow_empty_items `` to true to render nodes without URL.
5573
5674Publish Workflow
5775----------------
@@ -61,7 +79,7 @@ visible by use of the :doc:`publish workflow checker
6179<../core/publish_workflow>`.
6280
6381.. versionadded :: 1.1
64- The ``MenuContentVoter `` was added in CmfMenuBundle 1.1.
82+ The ``MenuContentVoter `` was introduced in CmfMenuBundle 1.1.
6583
6684The ``MenuContentVoter `` decides that a menu node is not published if the
6785content it is pointing to is not published.
0 commit comments