From 577abd9989e62603fc9b14f1947bdddb1c510a4b Mon Sep 17 00:00:00 2001 From: richardudovich Date: Mon, 27 Jul 2015 23:25:25 +1000 Subject: [PATCH 1/6] Removing the extend statement from cmf_routing_auto.xml in example --- tutorial/auto-routing.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/tutorial/auto-routing.rst b/tutorial/auto-routing.rst index c3d51a3b..3fc219da 100644 --- a/tutorial/auto-routing.rst +++ b/tutorial/auto-routing.rst @@ -190,7 +190,6 @@ You can now proceed to mapping your documents, create the following in your From 2f9109c227bc453f6018872d85d4791e18edcbc9 Mon Sep 17 00:00:00 2001 From: David Buchmann Date: Sat, 22 Aug 2015 16:25:49 +0200 Subject: [PATCH 2/6] document menu configuration options --- bundles/menu/configuration.rst | 20 +++++++++++++++++++ bundles/menu/menu_factory.rst | 36 +++++++++++++++++++++++++--------- 2 files changed, 47 insertions(+), 9 deletions(-) diff --git a/bundles/menu/configuration.rst b/bundles/menu/configuration.rst index 9c9c5fd4..9fc1457f 100644 --- a/bundles/menu/configuration.rst +++ b/bundles/menu/configuration.rst @@ -180,6 +180,26 @@ admin_recursive_breadcrumbs When editing a node, this setting will cause the Sonata admin breadcrumb to include ancestors of the node being edited. +content_url_generator +~~~~~~~~~~~~~~~~~~~~~ + +.. versionadded:: 1.2 + This option was introduced in version 1.2.0. Prior to 1.2, this option is + not available and the default service ``router`` is hardcoded. + +**type**: ``string`` **default**: ``router`` + +With this option, you can change what router should be used for generating +URLs from menu nodes of type "content". + +allow_empty_items +~~~~~~~~~~~~~~~~~ + +**type**: ``boolean`` **default**: ``false`` + +Whether menu nodes without URL should be hidden or rendered as text without a +link. + Admin Extensions ---------------- diff --git a/bundles/menu/menu_factory.rst b/bundles/menu/menu_factory.rst index 36736a3f..d3e93788 100644 --- a/bundles/menu/menu_factory.rst +++ b/bundles/menu/menu_factory.rst @@ -26,9 +26,17 @@ A menu item should have a URL associated with it. The CMF provides the from the ``content`` and ``routeParameters`` options when using the :ref:`dynamic router `. -The ``content`` option, if specified, must contain a class which implements -the ``RouteReferrersInterface``, see the :ref:`dynamic router -` documentation for more information. +The ``content`` option, if specified, must contain something that the content +URL generator can work with. When using the :ref:`dynamic router +`, this needs to be a class implementing +the ``RouteReferrersInterface``. You can alternatively specify a custom +``UrlGeneratorInterface`` with the ``content_url_generator`` configuration +option. + +.. versionadded:: 1.2 + The ``content_url_generator`` option was introduced in CmfMenuBundle 1.2.0. + Prior to 1.2, the default service ``router`` was hardcoded to generate URLs + from content. URL generation is absolute or relative, depending on the boolean value of the ``routeAbsolute`` option. @@ -44,14 +52,24 @@ of the three URL generation techniques to use. The values for this options can be one of the following: * ``null``: If the value is ``null`` (or the options is not set) then the link - type is determined automatically by looking at each of the ``uri``, ``route`` and - ``content`` options and using the first one which is non-null. + type is determined automatically by looking at each of the ``uri``, ``route`` + and ``content`` options and using the first one which is non-null. * **uri**: Use the URI provided by the ``uri`` option. * **route**: Generate a URL using the route named by the ``route`` option and the parameters provided by the ``routeParameters`` option. -* **content**: Generate a URL by passing the ``RouteReferrersInterface`` - instance provided by the ``content`` option to the router using any - parameters provided by the ``routeParameters`` option. +* **content**: Generate a URL by passing the value of the ``content`` option to + the content URL generator, using any parameters provided by the + ``routeParameters`` option. + +Menu Nodes without URL +~~~~~~~~~~~~~~~~~~~~~~ + +A menu node document might not have a URL, when that information was never set +or it points to a content that has been deleted meanwhile. In that case, there +are two options: The menu node can be skipped, or it can be rendered as text +without link. By default, the node is skipped. + +You can set ``cmf_menu.allow_empty_items`` to true to render nodes without URL. Publish Workflow ---------------- @@ -61,7 +79,7 @@ visible by use of the :doc:`publish workflow checker <../core/publish_workflow>`. .. versionadded:: 1.1 - The ``MenuContentVoter`` was added in CmfMenuBundle 1.1. + The ``MenuContentVoter`` was introduced in CmfMenuBundle 1.1. The ``MenuContentVoter`` decides that a menu node is not published if the content it is pointing to is not published. From c63e03dcb69266c59818d75c2345eb446a4bbb81 Mon Sep 17 00:00:00 2001 From: Gonzalo Vilaseca Date: Wed, 16 Sep 2015 13:40:40 +0100 Subject: [PATCH 3/6] Update the_router.rst --- quick_tour/the_router.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quick_tour/the_router.rst b/quick_tour/the_router.rst index 117b8085..be83f688 100644 --- a/quick_tour/the_router.rst +++ b/quick_tour/the_router.rst @@ -171,7 +171,7 @@ Now you can add a new ``Route`` to the tree using Doctrine:: $routesRoot = $documentManager->find(null, '/cms/routes'); $route = new Route(); - // set $routesBase as the parent and 'new-route' as the node name, + // set $routesRoot as the parent and 'new-route' as the node name, // this is equal to: // $route->setName('new-route'); // $route->setParentDocument($routesRoot); From 2dee439003ada8e13d5daf67b0fe6d6b8c0df595 Mon Sep 17 00:00:00 2001 From: mediamonks-robert Date: Thu, 5 Nov 2015 14:20:41 +0100 Subject: [PATCH 4/6] Update routing.rst Added a note about the config example using a controller as a service and explained how you can also use a controller with a fully qualified class name. --- book/routing.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/book/routing.rst b/book/routing.rst index 1cea2747..1af50450 100644 --- a/book/routing.rst +++ b/book/routing.rst @@ -332,6 +332,15 @@ Notice that ``enabled: true`` is no longer present. It's only required if no other configuration parameter is provided. The router is automatically enabled as soon as you add any other configuration to the ``dynamic`` entry. +.. note:: + + This example uses a controller which is defined as a service. You can also + configure a controller by using a fully qualified class name: + ``CmfContentBundle:Content:index``. + + For more information on using controllers as a service read cook book + section `How to Define Controllers as Services`_ + .. note:: Internally, the routing component maps these configuration options to @@ -529,3 +538,4 @@ For more information on the Routing component of Symfony CMF, please refer to: .. _`Doctrine ORM`: http://www.doctrine-project.org/projects/orm.html .. _`PHPCR-ODM`: http://www.doctrine-project.org/projects/phpcr-odm.html .. _`Routing`: http://symfony.com/doc/current/components/routing/introduction.html +.. _`How to Define Controllers as Services`: http://symfony.com/doc/current/cookbook/controller/service.html From 1ef51204e94ab1425290a7d6a73f141e6f0b6d7d Mon Sep 17 00:00:00 2001 From: David Buchmann Date: Mon, 14 Dec 2015 18:36:58 +0100 Subject: [PATCH 5/6] jackalope.check_login_on_server defaults to kernel.debug --- bundles/phpcr_odm/configuration.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bundles/phpcr_odm/configuration.rst b/bundles/phpcr_odm/configuration.rst index ce981ada..52e5a05d 100644 --- a/bundles/phpcr_odm/configuration.rst +++ b/bundles/phpcr_odm/configuration.rst @@ -29,7 +29,7 @@ session # optional parameters for Jackalope parameters: jackalope.factory: Jackalope\Factory - jackalope.check_login_on_server: false + jackalope.check_login_on_server: %kernel.debug% jackalope.disable_stream_wrapper: false jackalope.auto_lastmodified: true # see below for how to configure the backend of your choice @@ -58,7 +58,7 @@ session type="X" > Jackalope\Factory - false + %kernel.debug% false true @@ -79,7 +79,7 @@ session 'type' => 'X', 'parameters' => array( 'jackalope.factory' => 'Jackalope\Factory', - 'jackalope.check_login_on_server' => false, + 'jackalope.check_login_on_server' => '%kernel.debug%', 'jackalope.disable_stream_wrapper' => false, 'jackalope.auto_lastmodified' => true, ), @@ -160,7 +160,7 @@ Use a custom factory class for Jackalope objects. jackalope.check_login_on_server ............................... -**type**: ``boolean`` **default**: ``false`` +**type**: ``boolean`` **default**: ``%kernel.debug%`` If set to ``false``, skip initial check whether repository exists. You will only notice connectivity problems on the first attempt to use the repository. From 55f885bb200800cd36dbdda7480cebdd72f95050 Mon Sep 17 00:00:00 2001 From: David Buchmann Date: Sat, 2 Jan 2016 17:23:34 +0100 Subject: [PATCH 6/6] adjust check_login_on_server for version 1.3.1 --- bundles/phpcr_odm/configuration.rst | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/bundles/phpcr_odm/configuration.rst b/bundles/phpcr_odm/configuration.rst index 52e5a05d..5b3fc6a3 100644 --- a/bundles/phpcr_odm/configuration.rst +++ b/bundles/phpcr_odm/configuration.rst @@ -29,7 +29,7 @@ session # optional parameters for Jackalope parameters: jackalope.factory: Jackalope\Factory - jackalope.check_login_on_server: %kernel.debug% + jackalope.check_login_on_server: false jackalope.disable_stream_wrapper: false jackalope.auto_lastmodified: true # see below for how to configure the backend of your choice @@ -58,7 +58,7 @@ session type="X" > Jackalope\Factory - %kernel.debug% + false false true @@ -79,7 +79,7 @@ session 'type' => 'X', 'parameters' => array( 'jackalope.factory' => 'Jackalope\Factory', - 'jackalope.check_login_on_server' => '%kernel.debug%', + 'jackalope.check_login_on_server' => false, 'jackalope.disable_stream_wrapper' => false, 'jackalope.auto_lastmodified' => true, ), @@ -160,11 +160,16 @@ Use a custom factory class for Jackalope objects. jackalope.check_login_on_server ............................... -**type**: ``boolean`` **default**: ``%kernel.debug%`` +**type**: ``boolean`` **default**: ``false`` If set to ``false``, skip initial check whether repository exists. You will only notice connectivity problems on the first attempt to use the repository. +.. versionadded:: 1.3.1 + In version 1.2 and 1.3.0 of the DoctrinePhpcrBundle, the default value depends + on ``%kernel.debug%``. We recommend setting the value to false to avoid + bootstraping issues. + jackalope.disable_stream_wrapper ................................