.. You may want to use the usual include line. Uncomment and adjust the path. .. include:: ../Includes.txt ==================================== Browser Tutorial Backend Filter (en) ==================================== :Created: 2010-10-13T21:40:33 :Changed by: dirk :Changed: 2015-08-23T17:30:23 :Classification: browser_tut_befilter_en :Description: Extend your list views with a filter in the TYPO3 backend. It is a powerfull feature, if you have a lot of records per table. :Keywords: browser, backend, filter, tutorial :Author: Dirk Wildt - Die Netzmacher :Email: http://wildt.at.die-netzmacher.de :Website: http://die-netzmacher.de :Language: en |img-1| |img-2| Browser Tutorial Backend Filter (en)|img-3| .. _Browser-Tutorial-Backend-Filter-en: Browser Tutorial Backend Filter (en) ==================================== Extend your list views with a filter in the TYPO3 backend. It is a powerfull feature, if you have a lot of records per table. |img-4| Version: 7.2.6, 2015-08-23 Extension Key: browser\_tut\_befilter\_en Language: en Keywords: browser, backend, filter, tutorial Copyright 2011-2015, Dirk Wildt - Die Netzmacher, This document is published under the Open Content License available from `http://www.opencontent.org/opl.shtml `_ The content of this document is related to TYPO3 a GNU/GPL CMS/Framework available from `www.typo3.org `_ .. _Table-of-Contents: Table of Contents ----------------- `Browser Tutorial Backend Filter (en) 1 <#__RefHeading__1165_1172745218>`_ `Screen shot 3 <#__RefHeading__1945_293928275>`_ `Introduction 4 <#__RefHeading__12239_1904948122>`_ `What does the Tutorial do? 4 <#__RefHeading__12241_1904948122>`_ `What does the backend filter do? 4 <#__RefHeading__12243_1904948122>`_ `Further Information 4 <#__RefHeading__12245_1904948122>`_ `This tutorial in PDF format 4 <#__RefHeading__12247_1904948122>`_ `Browser Manual and Tutorials 4 <#__RefHeading__12249_1904948122>`_ `How to get a filter for the list view? 5 <#__RefHeading__1837_68072442>`_ `ext\_tables.php 5 <#__RefHeading__2257_68072442>`_ `tca.php 5 <#__RefHeading__1839_68072442>`_ `Profile 6 <#__RefHeading__1841_68072442>`_ `Supported TCA types 6 <#__RefHeading__446_126321051>`_ `Supported TCA eval values 6 <#__RefHeading__448_126321051>`_ `Supported page TSconfig 6 <#__RefHeading__1161_136652511>`_ `Supported Relations 6 <#__RefHeading__860_136652511>`_ `Non supported Features 6 <#__RefHeading__773_136652511>`_ `Markers which won't be replaced 6 <#__RefHeading__998_2088808190>`_ `Further Information 6 <#__RefHeading__724_761947717>`_ `Reference 7 <#__RefHeading__1843_68072442>`_ `ext\_tables.php 7 <#__RefHeading__1104_136652511>`_ `tca.php 7 <#__RefHeading__1224_136652511>`_ `Samples 8 <#__RefHeading__892_2088808190>`_ `Input 8 <#__RefHeading__1000_2088808190>`_ `Select 8 <#__RefHeading__1002_2088808190>`_ `Select with form\_type = user 9 <#__RefHeading__1004_2088808190>`_ `Forum 10 <#__RefHeading__11300_144712033>`_ `Credits 11 <#__RefHeading__1845_68072442>`_ `To the developer of be\_tablefilter 11 <#__RefHeading__2353_68072442>`_ `To-Do List 12 <#__RefHeading__12315_1904948122>`_ `Change Log 13 <#__RefHeading__12317_1904948122>`_ .. _Screen-shot: Screen shot ----------- |img-5| .. _Introduction: Introduction ------------ .. _What-does-the-Tutorial-do: What does the Tutorial do? ^^^^^^^^^^^^^^^^^^^^^^^^^^ This is a tutorial for the extension Browser (extkey: browser). It is only a step-by-step introduction for extending your list views with filters in the TYPO3 backend If you are interested in other issues of the Browser, please note the section "Further Informations" below. .. _What-does-the-backend-filter-do: What does the backend filter do? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - The Browser backend filter are for backend tables in the list module. - The filters work for every shown and configured column of your table or system table. - You just have to extend your TCA with a quite straight forward config\_filter block in addition to the well known config block. - Filter criteria are kept in the BE user session. - Filter criteria work for the CSV download as well. .. _Further-Information: Further Information ^^^^^^^^^^^^^^^^^^^ .. _This-tutorial-in-PDF-format: This tutorial in PDF format """"""""""""""""""""""""""" You find this manual as PDF file at - doc/manual.pdf - `http://typo3-browser.de/typo3conf/ext/browser\_tut\_befilter\_en/doc/ manual.pdf `_ .. _Browser-Manual-and-Tutorials: Browser Manual and Tutorials """""""""""""""""""""""""""" Manual: The Browser has it's own manual (with the reference of course). - HTML `http://typo3.org/extensions/repository/view/browser/ `_ - PDF: http://typo3-browser.de/typo3conf/ext/browser/doc/manual.pdf Tutorial Basics: A lot of step-by-step introductions. - HTML `http://typo3.org/extensions/repository/view/browser\_tut\_basics\_en/ `_ - PDF: `http://typo3-browser.de/typo3conf/ext/browser\_tut\_basics\_en/d oc/manual.pdf `_ .. _How-to-get-a-filter-for-the-list-view: How to get a filter for the list view? -------------------------------------- You have to extend the TCA of your extension. .. _ext-tables-php: ext\_tables.php ^^^^^^^^^^^^^^^ Your table need in the 'ctrl'-section an array 'filter'. See "ext\_tables.php" on page 7 below. .. _tca-php: tca.php ^^^^^^^ You have to add two entries to your TCA to see the filter work: - Add a key 'filter' => true to the 'ctrl'-Block of the table you want to be able to filter - Add a block 'config\_filter' to all columns of this table which you want to be available for filtering. This block 'config\_filter' follows the same syntax as the 'config' block. Both are configurations for a form field and are using the same tceform methods. There is only one option which is not part of the well known TCA options: fromto. See "tca.php" on page 7 below. .. _Profile: Profile ------- .. _Supported-TCA-types: Supported TCA types ^^^^^^^^^^^^^^^^^^^ input select without foreign table with foreign table .. _Supported-TCA-eval-values: Supported TCA eval values ^^^^^^^^^^^^^^^^^^^^^^^^^ eval - empty - trim - date, datetime .. _Supported-page-TSconfig: Supported page TSconfig ^^^^^^^^^^^^^^^^^^^^^^^ - ###CURRENT\_PID### - ###PAGE\_TSCONFIG\_ID### - ###PAGE\_TSCONFIG\_IDLIST### - ###PAGE\_TSCONFIG\_STR### .. _Supported-Relations: Supported Relations ^^^^^^^^^^^^^^^^^^^ All relation types in context with the TCA type select but not group: Simple relationlocalTable.field -> uid.foreignTable MM relationlocalTable.uid -> uid\_local.mm\_table.uid\_foreign -> uid.foreignTable MM relation opposite (bi-directional fields in the TCE form)foreignTable.uid -> uid\_local.mm\_table.uid\_foreign -> uid.localTable .. _Non-supported-Features: Non supported Features ^^^^^^^^^^^^^^^^^^^^^^ Relations to foreign tables can be configured in the page properties by - General Record Storage Page and - page TSconfig Both have the effect to add markers in the andWhere statement in the TCA configuration. Some markers won't be replaced by this extension. You won't get any proper result in this cases. .. _Markers-which-won-t-be-replaced: Markers which won't be replaced """"""""""""""""""""""""""""""" - ###REC\_FIELD\_[fieldname]### - ###THIS\_UID### - ###STORAGE\_PID### - ###SITEROOT### .. _Further-Information: Further Information """"""""""""""""""" Document "TYPO3 core APIs". See section ['columns'][fieldname]['config'] / TYPE: "select" .. _Reference: Reference --------- .. _ext-tables-php: ext\_tables.php ^^^^^^^^^^^^^^^ .. ### BEGIN~OF~TABLE ### .. _filter: filter """""" .. container:: table-row Property filter Data type boolean/string Description Filter may have this values: - false: Filter are dispabled - true : Filter are enabled for displayed fields, which are configured (see tca.php below) - filter\_for\_displayed\_fields\_only: same as true (see above) - filter\_for\_all\_fields: Filter are enabled for all configured fields **Example:** $TCA['tx\_org\_npzch'] = array ( 'ctrl' => array ( 'title' => 'LLL:EXT:org\_npzch/local...', ), 'filter' => 'filter\_for\_all\_fields', ... ), ); Default false .. ###### END~OF~TABLE ###### .. _tca-php: tca.php ^^^^^^^ .. ### BEGIN~OF~TABLE ### .. _fromto: fromto """""" .. container:: table-row Property fromto fromto\_labels Data type boolean array Description Use it for date fields. Usually you might need a filter for dates older or younger or between two dates. **Example:** 'config' => array ( 'type' => 'input', 'size' => '8', 'max' => '20', 'eval' => 'datetime', ), 'config\_filter' => array ( 'type' => 'input', 'size' => '8', 'max' => '20', 'eval' => 'date', 'fromto' => true, 'fromto\_labels' => array( 'from' => 'LLL:EXT:your\_extension...', 'to' => 'LLL:EXT:your\_extension...', ), ), Default false empty .. ###### END~OF~TABLE ###### .. _Samples: Samples ^^^^^^^ .. _Input: Input """"" .. ### BEGIN~OF~TABLE ### .. _input: input ~~~~~ .. container:: table-row Type input Example 'config' => array ( 'type' => 'input', 'size' => '8', 'max' => '20', 'eval' => 'datetime', ), 'config\_filter' => array ( 'type' => 'input', 'size' => '8', 'max' => '20', 'eval' => 'datetime', ), .. ###### END~OF~TABLE ###### .. _Select: Select """""" .. ### BEGIN~OF~TABLE ### .. _select: select ~~~~~~ .. container:: table-row Type select Example 'config' => array( 'type' => 'select', 'size' => 10, 'minitems' => 0, 'maxitems' => 999, 'MM' => 'tx\_org\_mm\_all', 'MM\_match\_fields' => array( 'table\_local' => 'tx\_org\_news', 'table\_foreign' => 'tx\_org\_headquarters' ), 'MM\_insert\_fields' => array( 'table\_local' => 'tx\_org\_news', 'table\_foreign' => 'tx\_org\_headquarters' ), 'foreign\_table' => 'tx\_org\_headquarters', 'foreign\_table\_where' => 'AND tx\_org\_headquarters.pid=###CURRENT\_PID###AND tx\_org\_headquarters.deleted = 0 AND tx\_org\_headquarters.hidden = 0AND tx\_org\_headquarters.sys\_language\_uid=###REC\_FIELD\_sys\_lang uage\_uid###ORDER BY tx\_org\_headquarters.title', ), 'config\_filter' => array( 'type' => 'select', 'size' => 1, 'MM' => 'tx\_org\_mm\_all', 'MM\_match\_fields' => array( 'table\_local' => 'tx\_org\_news', 'table\_foreign' => 'tx\_org\_headquarters' ), 'MM\_insert\_fields' => array( 'table\_local' => 'tx\_org\_news', 'table\_foreign' => 'tx\_org\_headquarters' ), 'foreign\_table' => 'tx\_org\_headquarters', 'foreign\_table\_where' => 'AND tx\_org\_headquarters.pid=###CURRENT\_PID###AND tx\_org\_headquarters.deleted = 0 AND tx\_org\_headquarters.hidden = 0AND tx\_org\_headquarters.sys\_language\_uid=###REC\_FIELD\_sys\_lang uage\_uid###ORDER BY tx\_org\_headquarters.title', 'items' => array( 'empty' => array( '0' => '', '1' => '', ), ), ), .. ###### END~OF~TABLE ###### .. _Select-with-form-type-user: Select with form\_type = user """"""""""""""""""""""""""""" .. ### BEGIN~OF~TABLE ### .. _select: select ~~~~~~ .. container:: table-row Type select Example 'config' => array( 'type' => 'select', 'size' => 10, 'minitems' => 0, 'maxitems' => 999, 'MM' => 'tx\_org\_mm\_all', 'MM\_match\_fields' => array( 'table\_local' => 'tx\_org\_news', 'table\_foreign' => 'tx\_org\_headquarters' ), 'MM\_insert\_fields' => array( 'table\_local' => 'tx\_org\_news', 'table\_foreign' => 'tx\_org\_headquarters' ), 'foreign\_table' => 'tx\_org\_headquarters', 'foreign\_table\_where' => 'AND tx\_org\_headquarters.pid=###CURRENT\_PID###AND tx\_org\_headquarters.deleted = 0 AND tx\_org\_headquarters.hidden = 0AND tx\_org\_headquarters.sys\_language\_uid=###REC\_FIELD\_sys\_lang uage\_uid###ORDER BY tx\_org\_headquarters.title', 'form\_type' => 'user', 'userFunc' => 'tx\_cpstcatree->getTree', 'treeView' => 1, 'expandable' => 1, 'expandFirst' => 0, 'expandAll' => 0, ), 'config\_filter' => array( 'type' => 'select', 'size' => 1, 'MM' => 'tx\_org\_mm\_all', 'MM\_match\_fields' => array( 'table\_local' => 'tx\_org\_news', 'table\_foreign' => 'tx\_org\_headquarters' ), 'MM\_insert\_fields' => array( 'table\_local' => 'tx\_org\_news', 'table\_foreign' => 'tx\_org\_headquarters' ), 'foreign\_table' => 'tx\_org\_headquarters', 'foreign\_table\_where' => 'AND tx\_org\_headquarters.pid=###CURRENT\_PID###AND tx\_org\_headquarters.deleted = 0 AND tx\_org\_headquarters.hidden = 0AND tx\_org\_headquarters.sys\_language\_uid=###REC\_FIELD\_sys\_lang uage\_uid###ORDER BY tx\_org\_headquarters.title', 'items' => array( 'empty' => array( '0' => '', '1' => '', ), ), ), .. ###### END~OF~TABLE ###### .. _Forum: Forum ----- |img-6| Illustration 2: The TYPO3-Frontend-Engine Browser Forum The Browser has its own forum. We speak English and German. You are welcome to post any question, bug or snippet code at TYPO3-Frontend-Engine Browser: Forum `http://typo3-browser-forum.de/ `_ .. _Credits: Credits ------- The core of the Browser backend filters is based on the TYPO3 extension be\_tablefilter. .. _To-the-developer-of-be-tablefilter: To the developer of be\_tablefilter ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Thanks to the developer of be\_tablefilter for their wonderful job. Thanks to - Bert Wendler and - Marcel Walczak .. _To-Do-List: To-Do List ---------- Nothing to do. .. _Change-Log: Change Log ---------- 7.2.6 **Improvement** \* #i0189: Extend BE-filter for ###CURRENT\_PID###\* #i0188: Extend BE-filter for MM\_match\_fields\* #i0187: Update BE-filter for TYPO3 6.2 7.0.4: **Update** Manual links 3.9.14: **Initial Release** Tutorial 13 .. ######CUTTER_MARK_IMAGES###### .. |img-1| image:: img-1.png .. :align: left .. |img-2| image:: img-2.jpeg .. :border: 0 .. :height: 20 .. :name: Grafik1 .. :width: 69 .. |img-3| image:: img-3.png .. :align: texttop .. :border: 0 .. :height: 16 .. :name: graphics3 .. :width: 18 .. |img-4| image:: img-4.png .. :align: bottom .. :border: 0 .. :height: 268 .. :name: graphics6 .. :width: 302 .. |img-5| image:: data: :alt: Frame1 .. :align: bottom .. :name: Frame1 .. |img-6| image:: img-6.jpeg .. :align: left .. :border: 0 .. :height: 161 .. :name: graphics81 .. :width: 302