Skip to content
Snippets Groups Projects
Commit 7891d13e authored by Matthieu Fesselier's avatar Matthieu Fesselier
Browse files

Merge branch 'version-link-text' into 'master'

feature: add link-text attribute

See merge request !90
parents a150926b bb1df29a
No related branches found
No related tags found
1 merge request!90feature: add link-text attribute
Pipeline #12000 passed with stage
in 48 seconds
source/_static/images/import_documentation/widgets-examples/widget-action.png

27.1 KiB

source/_static/images/import_documentation/widgets-examples/widget-action2.png

28.4 KiB

source/_static/images/import_documentation/widgets-examples/widget-action3.png

37.6 KiB

...@@ -75,7 +75,6 @@ Attributes ...@@ -75,7 +75,6 @@ Attributes
value-title="My custom and static title" value-title="My custom and static title"
></solid-display> ></solid-display>
.. _default-field: .. _default-field:
``default-[field]`` ``default-[field]``
~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~
...@@ -106,6 +105,17 @@ Attributes ...@@ -106,6 +105,17 @@ Attributes
Displays a link with a ``<solid-link>`` tag with the current resource as ``data-src`` and Displays a link with a ``<solid-link>`` tag with the current resource as ``data-src`` and
the value of the attribute as ``next``. the value of the attribute as ``next``.
.. _link-text-field:
``link-text-[field]``
~~~~~~~~~~~~~~~~~~~~~
*Works only with solid-display-link(-mailto/tel/blank) and solid-action*
*Available from version 0.18*
Modify the displayed value as link in :
- ``<a>`` for solid-display-link,
- ``<solid-link>`` in solid-action.
.. _src-field: .. _src-field:
``src-[field]`` ``src-[field]``
~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~
......
.. _widgets-examples:
Examples Examples
========= =========
...@@ -175,6 +177,71 @@ solid-set-div ...@@ -175,6 +177,71 @@ solid-set-div
*The border is applied on solid-set-div* *The border is applied on solid-set-div*
solid-action
~~~~~~~~~~~~
A classic example of solid-action use is a list of resources (users here) with only one field displayed and the possibility to access additionnal informations by clicking on "User details" :
.. code:: html
<solid-display
data-src="data/list/users.jsonld"
fields="name, details"
value-details="User details"
label-name="Name :"
widget-name="solid-display-value-label"
></solid-display>
.. figure:: ../../_static/images/import_documentation/widgets-examples/widget-action.png
:alt: Basic solid-display
This is the solid-display with action attribute and link-text-[field] attribute use to replace the basic value-[field] from above.
.. code:: html
<solid-display
data-src="data/list/users.jsonld"
fields="name, details"
label-name="Name :"
widget-name="solid-display-value-label"
action-details="user-details"
link-text-details="User details"
></solid-display>
.. figure:: ../../_static/images/import_documentation/widgets-examples/widget-action2.png
:alt: Widget solid-action
By adding a router, a route and another view, clicking on the solid-action displays the view (dotted border):
.. code:: html
<solid-router use-hash>
<solid-route
hidden
use-id
name="user-details"
></solid-route>
</solid-router>
<solid-display
data-src="data/list/users.jsonld"
fields="name, details"
label-name="Name :"
widget-name="solid-display-value-label"
action-details="user-details"
link-text-details="User details"
></solid-display>
<div data-view="user-details" hidden>
<solid-display
bind-resources
fields="first_name, last_name, username, email"
></solid-display>
</div>
.. figure:: ../../_static/images/import_documentation/widgets-examples/widget-action3.png
:alt: Widget solid-action with view
Step-by-step widget creation Step-by-step widget creation
---------------------------- ----------------------------
......
...@@ -84,7 +84,7 @@ Available templates : ...@@ -84,7 +84,7 @@ Available templates :
- **default** (no type keyword defined) - **default** (no type keyword defined)
- ``action``: Displays a link inside a ``<solid-link>`` tag with ``src`` for the ``data-src`` attribute, - ``action``: Displays a link inside a ``<solid-link>`` tag with ``src`` for the ``data-src`` attribute,
``value`` for the ``next`` attribute and ``label`` as text content. ``value`` for the ``next`` attribute and ``link-text`` as text content.
- ``multiple``: insert a ``solid-display`` with the ``@id`` of a container as ``data-src``. - ``multiple``: insert a ``solid-display`` with the ``@id`` of a container as ``data-src``.
The fields to display are chosen with the ``multiple-[field name]-fields`` attribute. The fields to display are chosen with the ``multiple-[field name]-fields`` attribute.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment