Skip to content

Commit

Permalink
Propery use heading levels
Browse files Browse the repository at this point in the history
  • Loading branch information
emodric committed Jul 3, 2017
1 parent f77a874 commit 230aae6
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 49 deletions.
12 changes: 6 additions & 6 deletions cookbook/custom_backend.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Implementing a backend involves the following:
every column you add that's not using a template for rendering

Configuring and enabling your new item type
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-------------------------------------------

Once you decide on your new item type identifier (in these examples, we will use
``my_item_type``), enabling it inside Content Browser is done with the following
Expand All @@ -61,7 +61,7 @@ For the list of all available configuration options, take a look at the
:doc:`configuration reference </reference/configuration>`.

Creating a Symfony service for the backend
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------------------------------------------

Every item type needs to have a Symfony service called backend. Backend's job is
to hook into the CMS and return the data from the CMS needed to build locations
Expand Down Expand Up @@ -91,7 +91,7 @@ the item type by using ``netgen_content_browser.backend`` tag:
- { name: netgen_content_browser.backend, item_type: my_item_type }
Creating ``ItemInterface`` and ``LocationInterface`` objects
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------------------------------------------------------------

As already mentioned, backend needs to return objects implementing
``Netgen\ContentBrowser\Item\LocationInterface`` and
Expand All @@ -104,7 +104,7 @@ a single column), so make sure that it contains any data that you will need to
render the templates.

Creating a preview template for the item
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
----------------------------------------

As already mentioned, you can enable a preview of your items with the following
configuration:
Expand All @@ -120,7 +120,7 @@ Creating this template is a simple task. The template receives the item in
question in an ``item`` variable, which you can use to render the template.

Implementing columns rendered via templates
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-------------------------------------------

Content Browser allows you to implement your custom columns by specifying a
template that will be used to render the cell data in the column.
Expand All @@ -142,7 +142,7 @@ the template receives the item in question in an ``item`` variable, which you
can use to render the template.

Implementing columns rendered via column value providers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--------------------------------------------------------

If rendering a column via Twig template is not suitable for you, you can use a
separate Symfony service to render the cell data of a column.
Expand Down
22 changes: 11 additions & 11 deletions cookbook/forms_usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ facilitate this, three custom Symfony form types have been implemented:
.. include:: usage_requirements.rst.inc

Single content browser type
~~~~~~~~~~~~~~~~~~~~~~~~~~~
---------------------------

Single content browser type allows you to select a single item of a predefined
item type.

Form type class
^^^^^^^^^^^^^^^
~~~~~~~~~~~~~~~

``Netgen\ContentBrowser\Form\Type\ContentBrowserType``

Available options
^^^^^^^^^^^^^^^^^
~~~~~~~~~~~~~~~~~

* ``item_type``

Expand All @@ -37,24 +37,24 @@ Available options
**type**: ``int``, **required**: No, **default value**: ``null``

Other options
^^^^^^^^^^^^^
~~~~~~~~~~~~~

Parent of this type is the Symfony ``TextType`` type, so any options available
in that type can be used in this type too.

Multiple content browser type
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-----------------------------

Multiple content browser type allows you to select one or more items of a
predefined item type.

Form type class
^^^^^^^^^^^^^^^
~~~~~~~~~~~~~~~

``Netgen\ContentBrowser\Form\Type\ContentBrowserMultipleType``

Available options
^^^^^^^^^^^^^^^^^
~~~~~~~~~~~~~~~~~

* ``item_type``

Expand Down Expand Up @@ -83,13 +83,13 @@ Available options
**type**: ``int``, **required**: No, **default value**: ``null``

Other options
^^^^^^^^^^^^^
~~~~~~~~~~~~~

Parent of this type is the Symfony ``CollectionType`` type, so any options
available in that type can be used in this type too.

Dynamic content browser type
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
----------------------------

Dynamic content browser type allows you to select a single item, however, in
contrast to ``ContentBrowserType`` type, this type allows you to select the item
Expand All @@ -100,12 +100,12 @@ one that will hold the selected item type (named ``item_type``) and the one that
will hold the selected item ID (named ``item_id``).

Form type class
^^^^^^^^^^^^^^^
~~~~~~~~~~~~~~~

``Netgen\ContentBrowser\Form\Type\ContentBrowserDynamicType``

Available options
^^^^^^^^^^^^^^^^^
~~~~~~~~~~~~~~~~~

* ``item_types``

Expand Down
8 changes: 4 additions & 4 deletions cookbook/html_usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ a piece of specially crafted HTML.
.. include:: usage_requirements.rst.inc

Calling the Content Browser from your HTML
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------------------------------------------

Use the following piece of HTML code to call the Content Browser, and replace
the relevant pieces of data to suit your needs (item type, CSS ID for the value
Expand Down Expand Up @@ -55,7 +55,7 @@ which will then hold the list of all custom parameters.
</div>

Calling the Content Browser from your Twig template
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
---------------------------------------------------

Alternatively, you can just use a handy Twig template and set the wanted options
via an ``include`` tag:
Expand Down Expand Up @@ -83,7 +83,7 @@ The following lists all available parameters that can be transferred to the
template.

Required parameters
^^^^^^^^^^^^^^^^^^^
~~~~~~~~~~~~~~~~~~~

* ``input_id``

Expand All @@ -98,7 +98,7 @@ Required parameters
**type**: ``string``

Optional parameters
^^^^^^^^^^^^^^^^^^^
~~~~~~~~~~~~~~~~~~~

* ``item_name``

Expand Down
2 changes: 1 addition & 1 deletion cookbook/javascript_usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ Content Browser can be called at will anywhere from your JavaScript code.
.. include:: usage_requirements.rst.inc

Calling the Content Browser from your JavaScript
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------------------------------------------------

TBD
2 changes: 1 addition & 1 deletion cookbook/usage_requirements.rst.inc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Requirements
~~~~~~~~~~~~
------------

Before you can use the Content Browser, you need to include its assets
in your page head:
Expand Down
4 changes: 2 additions & 2 deletions ezplatform/custom_params.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ eZ location and eZ content backends support two custom parameters for now:
* Overriding content types which will be selectable

Overriding content types which will be shown in the tree
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--------------------------------------------------------

To override which content types will be used to build the location tree, use
``location_content_types`` custom parameter, e.g.:
Expand All @@ -33,7 +33,7 @@ or in case of Twig template usage:
%}
Overriding content types which will be selectable
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-------------------------------------------------

To override which content types will be selectable in the list of items, use
``allowed_content_types`` custom parameter, e.g.:
Expand Down
32 changes: 16 additions & 16 deletions reference/configuration/item_types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ accessed from Symfony DIC with the service name
replaced with the actual identifier of your item type.

``name``
~~~~~~~~
--------

This is the human readable name of your item type. You can use a translation
placeholder here, which will be translated with ``ngcb`` catalog.

**type**: ``string``, **required**: Yes, **example**: ``item_types.my_item_type``

``min_selected``
~~~~~~~~~~~~~~~~
----------------

This is the number of items that needs to be selected at minimum to be able to
close the selection dialog.
Expand All @@ -26,7 +26,7 @@ calling the dialog.
**type**: ``int``, **required**: No, **default**: ``1``

``max_selected``
~~~~~~~~~~~~~~~~
----------------

This is the number of items that needs to be selected at maximum to be able to
close the selection dialog.
Expand All @@ -37,18 +37,18 @@ calling the dialog.
**type**: ``int``, **required**: No, **default**: ``0``

``parameters``
~~~~~~~~~~~~~~
--------------

With this, you can transfer a custom list of parameters to the item configuration,
together with all other configuration values described in this document.

**type**: ``array``, **required**: No, **default**: ``[]``

``tree``
~~~~~~~~
--------

``enabled``
^^^^^^^^^^^
~~~~~~~~~~~

Controls if the tree panel will be displayed or not.

Expand All @@ -57,10 +57,10 @@ This configuration can be overriden when calling the dialog.
**type**: ``bool``, **required**: No, **default**: ``true``

``search``
~~~~~~~~~~
----------

``enabled``
^^^^^^^^^^^
~~~~~~~~~~~

Controls if the search panel will be displayed or not.

Expand All @@ -69,10 +69,10 @@ This configuration can be overriden when calling the dialog.
**type**: ``bool``, **required**: No, **default**: ``true``

``preview``
~~~~~~~~~~~
-----------

``enabled``
^^^^^^^^^^^
~~~~~~~~~~~

Controls if the preview panel will be displayed or not.

Expand All @@ -81,45 +81,45 @@ This configuration can be overriden when calling the dialog.
**type**: ``bool``, **required**: No, **default**: ``true``

``template``
^^^^^^^^^^^^
~~~~~~~~~~~~

Specifies the template that will be used to render the preview panel.

**type**: ``string``, **required**: Yes, **example**: ``@App/ngcb/my_item_type.html.twig``

``columns``
~~~~~~~~~~~
-----------

Specifies the list of columns that are available for the item type.

At least a column with identifier ``name`` must exist and either ``template``
or ``value_provider`` configuration must be specified for each of the columns.

``name``
^^^^^^^^
~~~~~~~~

This is the human readable name of your column. You can use a translation
placeholder here, which will be translated with ``ngcb`` catalog.

**type**: ``string``, **required**: Yes, **example**: ``columns.my_item_type.some_column``

``template``
^^^^^^^^^^^^
~~~~~~~~~~~~

Specifies the template that will be used to render the cell in the column.

**type**: ``string``, **required**: No, **example**: ``@App/ngcb/my_item_type/some_column.html.twig``

``value_provider``
^^^^^^^^^^^^^^^^^^
~~~~~~~~~~~~~~~~~~

Specifies the identifier of a value provider that will be used to provide the
cell value.

**type**: ``string``, **required**: No, **example**: ``my_item_type\some_column``

``default_columns``
~~~~~~~~~~~~~~~~~~~
-------------------

Specifies the list of columns that will be shown when the dialog is first opened.

Expand Down
8 changes: 4 additions & 4 deletions reference/install_instructions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Installation instructions
=========================

Use Composer
~~~~~~~~~~~~
------------

Run the following command to install Netgen Content Browser:

Expand All @@ -11,7 +11,7 @@ Run the following command to install Netgen Content Browser:
$ composer require netgen/content-browser
Activate the bundle
~~~~~~~~~~~~~~~~~~~
-------------------

Activate the Content Browser in your kernel class together will all other
required bundles:
Expand All @@ -31,7 +31,7 @@ required bundles:
);
Activate the routes
~~~~~~~~~~~~~~~~~~~
-------------------

Add the following to your main ``routing.yml`` file to activate Content Browser
routes:
Expand All @@ -43,7 +43,7 @@ routes:
prefix: "%netgen_content_browser.route_prefix%"
Install assets
~~~~~~~~~~~~~~
--------------

Run the following from your repo root to install Content Browser assets:

Expand Down
4 changes: 2 additions & 2 deletions reference/symfony_services.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Available Symfony services
A number of Symfony services is available for usage in your code:

``netgen_content_browser.registry.backend``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-------------------------------------------

This service is a registry which holds all available backends. It is an
implementation of ``Netgen\ContentBrowser\Registry\BackendRegistryInterface``
Expand All @@ -18,7 +18,7 @@ and you can use it to manually load Content Browser items by their ID.
$item = $eZLocationBackend->loadItem(42);
Configuration services
~~~~~~~~~~~~~~~~~~~~~~
----------------------

Every backend has its own configuration service which can be used by the backend
to access all config options specified in Symfony semantic config, as well as
Expand Down

0 comments on commit 230aae6

Please sign in to comment.