DEPRECATION WARNING

This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.

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)

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, <http://wildt.at .die-netzmacher.de>

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

Screen shot

Frame1

Introduction

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?

  • 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

This tutorial in PDF format

You find this manual as PDF file at

Browser Manual and Tutorials

Manual: The Browser has it's own manual (with the reference of course).

Tutorial Basics: A lot of step-by-step introductions.

How to get a filter for the list view?

You have to extend the TCA of your extension.

ext_tables.php

Your table need in the 'ctrl'-section an array 'filter'. See "ext_tables.php" on page 7 below.

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

Supported TCA types

input

select

without foreign table

with foreign table

Supported TCA eval values

eval

  • empty
  • trim
  • date, datetime

Supported page TSconfig

  • ###CURRENT_PID###
  • ###PAGE_TSCONFIG_ID###
  • ###PAGE_TSCONFIG_IDLIST###
  • ###PAGE_TSCONFIG_STR###

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

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
  • ###REC_FIELD_[fieldname]###
  • ###THIS_UID###
  • ###STORAGE_PID###
  • ###SITEROOT###
Further Information

Document "TYPO3 core APIs". See section ['columns'][fieldname]['config'] / TYPE: "select"

Reference

ext_tables.php

filter

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

tca.php

fromto

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

Samples

Input
input

Type

input

Example

'config' => array (

'type' => 'input',

'size' => '8',

'max' => '20',

'eval' => 'datetime',

),

'config_filter' => array (

'type' => 'input',

'size' => '8',

'max' => '20',

'eval' => 'datetime',

),

Select
select

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' => '',

),

),

),

Select with form_type = user
select

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' => '',

),

),

),

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

The core of the Browser backend filters is based on the TYPO3 extension 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

Nothing to do.

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