From 2c680a3b013ee9bc2bcab508e225ac0d9c22ffe6 Mon Sep 17 00:00:00 2001 From: David Buchmann Date: Sun, 20 Aug 2017 16:26:06 +0200 Subject: [PATCH] add book into bundles doc --- book/handling_multilang.rst | 349 ------------ book/index.rst | 15 - book/installation.rst | 294 ---------- book/map.rst.inc | 6 - book/routing.rst | 538 ------------------ book/simplecms.rst | 164 ------ book/static_content.rst | 81 --- book/structuring_content.rst | 175 ------ bundles/content/introduction.rst | 3 - bundles/core/publish_workflow.rst | 12 +- bundles/phpcr_odm/configuration.rst | 4 +- bundles/phpcr_odm/index.rst | 1 + bundles/phpcr_odm/introduction.rst | 11 + .../phpcr_odm/models.rst | 37 +- bundles/phpcr_odm/multilang.rst | 7 + bundles/routing/dynamic.rst | 5 +- bundles/routing/introduction.rst | 8 +- bundles/simple_cms/introduction.rst | 3 - cookbook/editions/cmf_core.rst | 10 +- cookbook/editions/cmf_sandbox.rst | 12 +- cookbook/map.rst.inc | 1 - index.rst | 17 - quick_tour/the_big_picture.rst | 19 +- quick_tour/the_model.rst | 2 +- quick_tour/the_third_party_bundles.rst | 37 +- tutorial/sonata-admin.rst | 5 - 26 files changed, 92 insertions(+), 1724 deletions(-) delete mode 100644 book/handling_multilang.rst delete mode 100644 book/index.rst delete mode 100644 book/installation.rst delete mode 100644 book/map.rst.inc delete mode 100644 book/routing.rst delete mode 100644 book/simplecms.rst delete mode 100644 book/static_content.rst delete mode 100644 book/structuring_content.rst rename book/database_layer.rst => bundles/phpcr_odm/models.rst (91%) diff --git a/book/handling_multilang.rst b/book/handling_multilang.rst deleted file mode 100644 index 8d6c8dd3..00000000 --- a/book/handling_multilang.rst +++ /dev/null @@ -1,349 +0,0 @@ -.. index:: - single: Multi Language; Book - -Handling Multi-Language Documents -================================= - -The default storage layer of the CMF, PHPCR-ODM, can handle translations -transparently. - -.. tip:: - - This chapter assumes you already have an idea how to interact with - PHPCR-ODM, which was introduced in the :doc:`Database chapter `. - -.. caution:: - - You also need the ``intl`` php extension installed and enabled (otherwise - composer will tell you it can't find ``ext-intl``). If you get issues that some - locales can not be loaded, have a look at `this discussion about ICU`_. - -Initial Language Choice: Lunetics LocaleBundle ----------------------------------------------- - -The CMF recommends to rely on the `LuneticsLocaleBundle`_ -to handle requests to ``/`` on your website. This bundle provides the tools -to select the best locale for the user based on various criteria. - -When you configure ``lunetics_locale``, it is recommended to use a parameter -for the locales, as you need to configure the locales for other bundles -(e.g. the CoreBundle) too. - -.. configuration-block:: - - .. code-block:: yaml - - lunetics_locale: - allowed_locales: "%locales%" - - .. code-block:: xml - - - - - - %locales% - - - - .. code-block:: php - - $container->loadFromExtension('lunetics_locale', array( - 'allowed_locales' => '%locales%', - )); - -Configuring Available Locales ------------------------------ - -The CoreBundle needs to be configure with the available locales. If it is -not configured with locales, it registries a listener that removes all -translation mapping from PHPCR-ODM documents. - -.. configuration-block:: - - .. code-block:: yaml - - cmf_core: - multilang: - locales: "%locales%" - - .. code-block:: xml - - - - - - %locales% - - - - .. code-block:: php - - $container->loadFromExtension('cmf_core', array( - 'multilang' => array( - 'locales' => '%locales%', - ), - )); - -PHPCR-ODM multi-language Documents ----------------------------------- - -You can mark any properties as being translatable and have the document -manager store and load the correct language for you. Note that translation -always happens on a document level, not on the individual translatable fields. - -.. code-block:: php - - `". - -.. _book_handling-multilang_sonata-admin: - -Sonata PHPCR-ODM Admin ----------------------- - -.. note:: - - Using sonata admin is one way to make your content editable. A book - chapter on sonata admin is planned. Meanwhile, read - :doc:`Sonata Admin <../tutorial/sonata-admin>` in the "Creating a CMS" - tutorial. - -The first step is to configure sonata admin. You should place the -LuneticsLocaleBundle language switcher in the ``topnav`` bar. To do this, -configure the template for the ``user_block``: - -.. configuration-block:: - - .. code-block:: yaml - - # app/config/config.yml - sonata_admin: - # ... - templates: - user_block: AcmeCoreBundle:Admin:admin_topnav.html.twig - - .. code-block:: xml - - - - - -