Skip to content

Commit

Permalink
Add example for select.join (TYPO3-Documentation#775)
Browse files Browse the repository at this point in the history
- Add small example for select.join.
- Improve explanatory text

Previously, the explanatory text was slightly misleading because
it instructed to use the table name where in fact an entire
join clause (without the word "JOIN") can be used including
aliasing the table and adding a constraint with "ON".
  • Loading branch information
sypets authored and brotkrueml committed Aug 10, 2023
1 parent cbc6a34 commit c190064
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions Documentation/Functions/Select.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ uidInList
select.uidInList = this
.. _select-pidInList:
.. _select_pidInList:

pidInList
---------
Expand Down Expand Up @@ -342,10 +341,29 @@ join, leftjoin, rightjoin
:aspect:`Data type`
:t3-data-type:`string` / :ref:`stdWrap`

:aspect:`Description`
Enter the table name for JOIN, LEFT OUTER JOIN and RIGHT OUTER JOIN
Enter the JOIN clause without :sql:`JOIN`, :sql:`LEFT OUTER JOIN` and :sql:`RIGHT OUTER JOIN`
respectively.

.. rubric:: Example

Fetch related `sys_category` records stored in the MM intermediate table:

.. code-block:: typoscript
:caption: EXT:site_package/Configuration/TypoScript/setup.typoscript
10 = CONTENT
10 {
table = sys_category
select {
pidInList = root,-1
selectFields = sys_category.*
join = sys_category_record_mm mm ON mm.uid_local = sys_category.uid
# ....
}
}
See :ref:`select_pidInList` for more examples.


.. _select-markers:

Expand Down

0 comments on commit c190064

Please sign in to comment.