From 3f3753b1b45950d0b6c954d612f440d9e4d4fd42 Mon Sep 17 00:00:00 2001 From: "lina.wolf" Date: Fri, 27 Dec 2024 06:13:30 +0100 Subject: [PATCH] [TASK] Fuse function numrows into stdwrap It cannot be used in any other place so it is just a stdwrap function --- Documentation/Functions/Numrows.rst | 69 ----------------------------- Documentation/Functions/Stdwrap.rst | 39 ++++++++++++++++ 2 files changed, 39 insertions(+), 69 deletions(-) delete mode 100644 Documentation/Functions/Numrows.rst diff --git a/Documentation/Functions/Numrows.rst b/Documentation/Functions/Numrows.rst deleted file mode 100644 index 0a2c8dd0e..000000000 --- a/Documentation/Functions/Numrows.rst +++ /dev/null @@ -1,69 +0,0 @@ -.. include:: /Includes.rst.txt -.. index:: - Functions; numRows - Database; count -.. _numrows: - -======= -numRows -======= - -This object allows you to specify a :sql:`SELECT` query, which will be -executed in the database. The object then returns the number of -rows, which were returned by the query. - -.. contents:: - :local: - -.. index:: _numRows; Properties -.. _numRows-properties: - -Properties -========== - -.. _numrows-table: - -table ------ - -.. confval:: table - :name: _numrows-table - :type: Table name - - Name of the database table to query. - -.. _numrows-select: - -select ------- - -.. confval:: select - :name: numrows-select - :type: :ref:`select` - - Select query for the operation. - - The sub-property :typoscript:`selectFields` is overridden internally with - :sql:`count(*)`. - -.. _numRows-examples: - -Example -======= - -Get the number of content elements within certain :sql:`colPos` of the current -page. - -.. code-block:: typoscript - :caption: EXT:site_package/Configuration/TypoScript/setup.typoscript - - 10 = FLUIDTEMPLATE - 10 { - variables { - numberOfContentElementsInColPosOne = TEXT - numberOfContentElementsInColPosOne.numRows { - table = tt_content - select.where = {#colPos}=1 - } - } - } diff --git a/Documentation/Functions/Stdwrap.rst b/Documentation/Functions/Stdwrap.rst index fcc3114b3..cca800f61 100644 --- a/Documentation/Functions/Stdwrap.rst +++ b/Documentation/Functions/Stdwrap.rst @@ -194,6 +194,7 @@ Properties for getting data .. _stdwrap-numRows: + .. _numrows: .. confval:: numRows :name: stdwrap-numRows @@ -201,6 +202,44 @@ Properties for getting data Returns the number of rows resulting from the supplied :sql:`SELECT` query. + .. _numRows-examples: + + .. rubric:: Example + + Get the number of content elements within certain :sql:`colPos` of the current + page. + + .. code-block:: typoscript + :caption: EXT:site_package/Configuration/TypoScript/setup.typoscript + + 10 = FLUIDTEMPLATE + 10 { + variables { + numberOfContentElementsInColPosOne = TEXT + numberOfContentElementsInColPosOne.stdWrap.numRows { + table = tt_content + select.where = {#colPos}=1 + } + } + } + + .. _numRows-properties: + .. _numrows-table: + + .. confval:: numRows.table + :name: _numrows-table + :type: Table name + + Name of the database table to query. + + .. _numrows-select: + + .. confval:: numRows.select + :name: numrows-select + :type: :ref:`select` + + Select query for the operation. + .. _stdwrap-preUserFunc: