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 Search and Filter (en)

Author:Kasper Skårhøj
Created:2002-11-01T00:32:00
Changed by:dirk
Changed:2014-05-01T03:42:23
Classification:browser_tut_search_en
Description:Provide a search form and filters for your data on your website. The Browser - the TYPO3-Frontend-Engine - enables searching and filtering in every database. The Browser enables to search in areas like from last month to next month or from 10.000 EUR to 20.000 EUR. It enables a radial serach (Umkreissuche) in every database. Category menus can displayed in form of a tree view.
Keywords:forAdmins, forDevelopers, browser, typo3 without php, tutorial, search, filter, radial search, umkreissuche, treeview, areas
Author:Dirk Wildt, Die Netzmacher
Email:http://wildt.at.die-netzmacher.de
Website:http://die-netzmacher.de
Language:en

img-1 img-2 extKey: browser_tut_search_en img-3

Browser Tutorial Search and Filter (en)

Provide a search form and filters for your data on your website. The Browser - the TYPO3-Frontend-Engine - enables searching and filtering in every database. The Browser enables to search in areas like from last month to next month or from 10.000 EUR to 20.000 EUR. It enables a radial serach (Umkreissuche) in every database. Category menus can displayed in form of a tree view.

img-4

Version: 4.9.0, 2014-05-02 - Version is corresponding with the version of the Browser.

Extension Key: browser_tut_search_en - Tutorial for the extension Browser (extkey: browser)

Language: en

Keywords: forAdmins, forDevelopers, browser, typo3 without php, tutorial, search, filter, radial search, umkreissuche, treeview, areas

Copyright 2009-2014, 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

Table of Contents

Browser Tutorial Search and Filter (en) 1

Screen Shots 3

Frontend 3

Backend 5

Introduction 6

What does the Tutorial do? 6

What does the Browser Search and Filter do? 6

Further Information 6

Tutorial search 7

Example with tt_news 7

Test it! 8

Configuring the search form 10

Extending the search 12

Search and filter 13

Security 13

Tutorial filters and a category menu 14

The Common Ground 14

The Difference 14

Workflow 14

HTML Template 15

TypoScript 16

TypoScript Object Browser 17

Tutorial Radial Search (Umkreissuche) 18

What does it do? 18

Configuring 18

Performance 20

Tutorial tree view 21

Hierarchical list, hierarchical checkbox 21

Restrictions 21

What does this tutorial do? 21

Step overview 21

cps_tcatree 22

Extending the SQL table manufacturer 22

Extending the TCA configuration 23

Frontend works 26

Tree view in depth 30

Based on the jQuery plugin jsTree 30

Cookies 30

Themes 31

More than one tree view 32

Disable the tree view / top level only 34

How to add an own script? 35

Use marker in your script 35

Restrictions 35

Known bugs, unproper usability 36

More examples 37

Quick Shop - 1 Filter 37

Green Cars - Dynamic Filter 41

Organiser - Filter for a period (data area) 45

Condition for a Filter 47

Configuring hits 49

The difference between counting and displaying 49

Performance 49

Disable counting 49

cObject 50

Display conditions for a filter item 50

The "no value" label 50

Replace values 51

Configure or disable hits 51

Reference 52

master_templates 53

CATEGORY_MENU 54

CHECKBOX 54

RADIOBUTTONS 54

RADIAL SEARCH 55

SELECTBOX 55

TREEVIEW 56

filter condition 57

AREAS 58

AREA - Period interval 59

AREA - Period hard coded 60

AREA - Currency hard coded 60

What's new in Version 4? 61

Filter: AND 61

Filter: Checkboxes for Selectbox 61

Filter: cObject 61

Filter: conditions 61

Filter: radial search (de: Umkreissuche) 61

Filter: tree view 61

What's new in Version 3.6? 63

Area and interval: get parameters with date 63

Category Menu 63

Configurable: Search respects Filters 63

Filter for areas 63

Filter for local table 63

Helpful suggestions 64

Forum 64

Credits 65

dorn & malag 65

LEG Thüringen 65

To-Do List 66

Known bugs 67

Change Log 68

Illustration Index 70

Screen Shots

Frontend

Colored search words

Frame3

Tree view and select boxes

Frame3

The Browser enables you, to move every category table to a filter.

In the illustration above are four category tables used, the first one is tree view, the other three are usual checkboxes.

Frame3

The Browser filter modul enables you to use hierarchical checkboxes.

Frame3

The illustration above displays filter in a so called depending mode: Items without any hit won't displayed.

You can configure, if hits should displayed or not.

See the tutorial 'Green Cars - Dynamic Filter' on page 41 below.

Check boxes

Frame3

Category menu and areas

Frame3

The illustration above displays a category menu: a filter in form of a list.

And this list is an area. Area means values from one value to a value like from the first day of this week to the last day of this week.

Backend

Frame3

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 the configuration of the search functionality and filters.

If you are interested in other issues, please note the section "Further Informations" below.

What does the Browser Search and Filter do?

Filter

Filter your data by category menus, checkboxes, radiobuttons, selectboxes and treeviews

  • Filter are configurable. Examples for possibilities:
    • Items are cObjects
    • You can add a first item like "All Cars"
  • Filter are dynamically. If there isn't any hit, filter items won't be displayed. It's configurable.
  • Filter count hits. It's configurable.
  • Filter can handle data areas. Example for a data area: from January to December, from 10.000 EUR to 20.000EUR

Further Information

This tutorial in PDF format

You find this manual as PDF file at

Browser Manual and Browser Tutorial Basics

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

Tutorial filters and a category menu

You can extend the search form with filters in form of

  • checkboxes,
  • radiobuttons and
  • selectboxes.

And you can add a

category menu

to your HTML template within or without the search form.

The Common Ground

Both have the same Effect

There is no difference between filters and a category menu in principle. Both enables the visitor of your website to search structured. Structured means:

Visitors can limit the amount of records – they can search for data – by given categories like:

  • Display all news with the category “society”.
  • Display all events, which will happen “next week”.

The difference between filters and a category menu isn't the effect but the rendered HTML code.

The Difference

Filters are a Part of an HTML Form

Filters have to be rendered as a COA object CHECKBOX, RADIOBUTTON or SELECTBOX. All of them are a part of an HTML form. Non item of them will be rendered as a link directly. All of them have to be placed within the Marker ###SEARCHBOX###.

AJAX

Because of AJAX filters have to stand outside the <div class="listarea">.

Workflow

Add to your template the table.field, which should used as a filter or category menu

You have to place it within the ###SEARCHBOX### marker, if you like to use a filter as a checkbox, radiobutton or selectbox.

You have to place it within the ###SEARCHBOX### marker too, if you like to use a filter as a category menu.

Add to your TypoScript the table.field

Copy one of the Content Objects CATEGORY_MENU, CHECKBOX, RADIOBUTTON, SELECTBOX or TREEVIEW from the master_templates array to the table.field.

Configure the category menu , checkbox, radiobuttons, selectbox or treeview.

A good example for filters is the extension Green Cars. Green Cars provides the German case story "Fallstudie grüne-autos.org - Datenbank in drei Stunden". It explains very well, what you have to know, if you want to use filters.

See

Frame3

HTML Template

Add to your template the table.fields you want to use as filters like in the snippet below.

See line 10 to 12.

<!-- ###TEMPLATE_LIST### begin -->

###MY_TITLE###

<!-- ###SEARCHFORM### begin -->

<div class="searchbox searchbox-###VIEW###-###MODE###">

<form action="###ACTION###" method="post" name="Testform">

<input type="hidden" name="no_cache" value="1" />

<input class="sword" type="text" name="tx_browser_pi1[sword]"onfocus="if(this.value =='###SWORD_DEFAULT###')this.value=''" value="###SWORD###" />

<input class="button" type="submit" value="###BUTTON###" />

<input class="button" type="button" onclick="location='###MY_URL###'"value="###MY_RESET###" />

###TX_BZDSTAFFDIRECTORY_LOCATIONS.TITLE###

###TX_BZDSTAFFDIRECTORY_FUNCTIONS.TITLE###

###TX_BZDSTAFFDIRECTORY_GROUPS.GROUP_NAME###

###RESULTPHRASE###

</form>

</div><!-- ###SEARCHFORM### end -->

...

...

TypoScript

Add the table.fields like in the snippet below.

Line 6: Add the array filter.Line 7, 10, 13: Add the tables.Line 8, 11, 14: Add the fields.qLine 8, 11, 14: Copy to the fields the selectbox from the array master_templates

plugin.tx_browser_pi1 {

views {

list {

1 {

...

filter {

tx_bzdstaffdirectory_locations {

title < plugin.tx_browser_pi1.displayList.master_templates.checkbox

}

tx_bzdstaffdirectory_groups {

group_name < plugin.tx_browser_pi1.displayList.master_templates.radiobuttons

}

tx_bzdstaffdirectory_functions {

title < plugin.tx_browser_pi1.displayList.master_templates.selectbox

}

}

...

}

}

}

}

TypoScript Object Browser

Frame3

If you want to configure a filter / select box, please open the field array in your TypoScript Object Browser.

You will see a lot of commented properties like in the illustration below:

Frame3

That's it!

Tutorial Radial Search (Umkreissuche)

What does it do?

Radial Search (Umkreissuche) enables you, to search for records by distance. Your records must be geo-coded: they must have a latitude and a longitude. :sup:`0 <#sdfootnote2sym>`_

Radial Search (Umkreissuche) extends your search form with

  • an input field for a postal code and / or a city, which will auto- completed by AJAX
  • a select box with options for a radius.

Radial Search (Umkreissuche) takes care, that given distance and radius will respected by the search.

Each record will extended with a field, which contains the distance.

You can display records too, which aren't within the radius.

Configuring

Extension Radial Search (Umkreissuche)
  • Install the extension Radial Search (Umkreissuche) and enable it.

  • Add a folder "Radialsearch" to your page tree. It will needed for storing the postal code data.

  • Add a folder "Radialsearch" to your file list. It will needed for the postal code *.txt-file.

  • Maintain the property [Database] of the extension manager.

    • You have to upload a file with the needed postal codes.
    • The workflow should be self-explained.
  • Include the Static Template and take care of the ordering :sup:`0 <#sdfootnote3sym>`_ :

    • Radial Search (radialsearch)
    • Browser (browser)
  • Maintain the properties of the Constant Editor of the page, where you like to use Radial Search (Umkreissuche)

    You have to disable the jQuery UI CSS only, because your are controlling the CSS by the Browser plugin.See category [RADIAL SEARCH – CSS] > field: CSS jQuery UI file

TypoScript
Extend the search form with the Radial Search fields input and select box.

Extend your filter array with a RADIALSEARCH filter like in the snippet below (here: list view 501 :sup:`0 <#sdfootnote4sym>`_ ). See line 6.

plugin.tx_browser_pi1 {

views {

list {

501 {

filter {

radialsearch < plugin.tx_browser_pi1.displayList.master_templates.radialsearch

}

}

}

}

}

Extend your HTML with a RADIALSEARCH hashmarker. See from line 7 to 16.

plugin.tx_browser_pi1 {

views {

list {

501 {

htmlSnippets {

marker {

filter >

filter = TEXT

filter {

value (

<div class="filter">

###TX_ORG_HEADQUARTERSCAT.TITLE###

###RADIALSEARCH###

</div>

)

}

}

}

}

}

}

}

}

Extend the list view with Radial Search informations

You can control HTML and CSS depending on distance and radius:

  • without any radial search

  • with a radial search for records,

    • which are within or
    • which are outside of

    the given radius.

Sample for a string like "234 Km linear distance from 10115 Berlin and"

plugin.tx_browser_pi1 {

views {

list {

501 {

...

tx_org_headquarters {

// placeholder: radialsearch linear distance

deleted < plugin.tx_radialsearch.masterTemplates.linearDistanceString

...

This will replace the marker

###TX_ORG_HEADQUARTERS.DELETED###

with

  • 237 Km linear distance from 10999 Berlin Kreuzberg
  • 237 Km Luftlinie entfernt von 10999 Berlin Kreuzberg

depending of the current language (default (en), de).

See Organiser > heaquarters > setup.txt »

Sample for a CSS color

plugin.tx_browser_pi1 {

views {

list {

501 {

...

tx_org_headquarters {

// placeholder: radialsearch HTML class depending on radius

crdate < plugin.tx_radialsearch.masterTemplates.htmlClass

...

This will replace the marker

###TX_ORG_HEADQUARTERS.CRDATE###

with

  • radialsearch radialsearch-within-radius
  • radialsearch radialsearch-outside-radius

depending of the distance.

HTML snippet:

<div class="###TX_ORG_HEADQUARTERS.CRDATE###">

...

</div>

See Organiser > heaquarters > setup.txt »

Performance

Example with worldwide postal codes

Postal codes near by 1.2 million :sup:`0 <#sdfootnote5sym>`_ records and a database with 540 address records

  • Query with filter and without a radial search needs round about 0.03 seconds
  • Query with filter and a radial search needs round about 1.3 seconds
Example with Postal Codes of Germany

Postal codes near by 16 000 :sup:`0 <#sdfootnote6sym>`_ records, database with 540 address records

  • Query with filter and without a radial search needs round about 0.03 seconds
  • Query with filter and a radial search needs round about 0.05 seconds

Tutorial tree view

Hierarchical list, hierarchical checkbox

A tree view is a hierarchical list or a hierarchical checkbox.

Restrictions

If you want to know, if a tree view is the solution for your demands, please refer to "Restrictions" on page 35 below.

Frame3

What does this tutorial do?

We like to display categories in a tree view. This tutorial demonstrates, how to extend your own extension. We take the extension green_cars and extend it with a tree view like

  • manufacturer 1

    • model a
    • model b
    • model c
  • manufacturer 2

    ...

Step overview

  • Installing of the extension cps_tcatree
  • Define the dependency of cps_tcatree
  • Extending the SQL table manufacturer with a parent field for uids
  • Extending the TCA configuration for the table manufacturer
  • Extending the HTML template with a marker for the tree view
  • Extending the TypoScript with a configuration for the tree view

cps_tcatree

Installing

Frame3

  • Install the extension "Record tree for TCA" (extkey: cps_tcatree).
  • Enable the extension.
Define the dependency in ext_emconf.php

Define the dependency to cps_tcatree in the configuration of your extension. The definition of the dependency isn't obligatory but is best practise. See lines 'dependencies' and 'constraints' in the snippet below. The file is ext_emconf.php.

wwwrun@s15315906 : .../typo3conf/ext/green_cars> nano ext_emconf.php

<?php

...

$EM_CONF[$_EXTKEY] = array(

...

'dependencies' => 'browser, cps_tcatree ',

...

'constraints' => array(

'depends' => array(

'browser' => '3.9.6-0.0.0',

'cps_tcatree' => '0.3.0-0.0.0',

),

...

),


?>

Extending the SQL table manufacturer

We need a field for the parent uid of each category, which should a child of another category. We extend the SQL table with the field uid_parent. See the snippet below.

wwwrun@s15315906 : .../typo3conf/ext/green_cars> nano ext_tables.sql

...

#

# Table structure for table 'tx_greencars_manufacturer'

#

CREATE TABLE tx_greencars_manufacturer (

uid int(11) NOT NULL auto_increment,

pid int(11) DEFAULT '0' NOT NULL,

uid_parent int(11) DEFAULT '0' NOT NULL,

...

);

...

The table tx_greencars_manufacturer is now able to administer subcategories.

Extending the TCA configuration

Make the parent uid known to other tables

Tables which are connected with the manufacturer table, has to know about the parent uid of the manufacturer table. We configure ext_tables.php like in the TCA snippet below. See the line with 'treeParentField':

wwwrun@s15315906 : .../typo3conf/ext/green_cars> nano ext_tables.php

...

$TCA['tx_greencars_manufacturer'] = array (

'ctrl' => array (

'title' => 'LLL:EXT:green_cars/locallang_db.xml:tx_greencars_manufacturer',

'label' => 'title',

'tstamp' => 'tstamp',

'crdate' => 'crdate',

'cruser_id' => 'cruser_id',

'treeParentField' => 'uid_parent',

...

),

);

...

For your background: The configuration of 'treeParentField' is a demand of the extension cps_tcatree. And it is a demand of the extension TYPO3 Browser, which is using the TCA based on cps_tcatree.

Extend the TCA form

You have to edit two items and to add the field configuration.

Please add the field name 'uid_parent' to

  • showRecordFieldList
  • types. X

wwwrun@s15315906 : .../typo3conf/ext/green_cars> nano tca.php

...

$TCA['tx_greencars_manufacturer'] = array (

...

'interface' => array (

'showRecordFieldList' => 'hidden,title, uid_parent '

),

...

'columns' => array (

...

'uid_parent' => array (

'exclude' => 0,

'label' => 'LLL:EXT:green_cars/locallang_db.xml:tx_greencars_manuf acturer.uid_parent',

'config' => array (

'type' => 'select',

'form_type' => 'user',

'userFunc' => 'tx_cpstcatree->getTree',

'foreign_table' => 'tx_greencars_manufacturer',

'treeView' => 1,

'expandable' => 1,

'expandFirst' => 0,

'expandAll' => 0,

'size' => 1,

'minitems' => 0,

'maxitems' => 2,

'trueMaxItems' => 1,

),

),

...

),

'types' => array (

'0' => array('showitem' => 'hidden;;1;;1-1-1, title;;;;2-2-2, uid_parent ')

),

...

);

...

If you take for the label of the field uid_parent a LLL-value like in the snippet above, please add the value to your locallang file.

If you want to know more about the configuration and possibilities of the uid_parent field, please refer to the manual of the cps_tcatree.

Update your extension

You have to update your extension like in the illustration below. The field "uid_parent" will added to the manufacturer SQL table.

Frame3

Ready for tree ordering!

Clear the Cache of your TYPO3 backend.

Open the manufacturer form. You will get a result similar to the illustration below.

Frame3

You job is now, to add models and to allocate manufacturers.

After finishing you should have a result like in the illustration below.

Frame3

Local table with tree view

tx_greencars_main.manufacturer is connected with the manufacturer table in our example green_cars.

We have to update the configuration of the field manufacturer of the table tx_greencars_main in the TCA. See the snippet below.

wwwrun@s15315906: .../typo3conf/ext/green_cars> nano tca.php

...

$TCA['tx_greencars_main'] = array (

...

'columns' => array (

...

'manufacturer' => array (

'exclude' => 0,

'label' => 'LLL:EXT:green_cars/locallang_db.xml:tx_greencars_main. manufacturer',

'config' => array (

'type' => 'select',

'minitems' => 0,

'size' => 3,

'maxitems' => 5,

'form_type' => 'user',

'userFunc' => 'tx_cpstcatree->getTree',

'treeView' => 1,

'expandable' => 1,

'expandFirst' => 1,

'expandAll' => 0,

'foreign_table' => 'tx_greencars_manufacturer',

'foreign_table_where' => 'AND 1 ORDER BY tx_greencars_manufacturer.uid',

'suppress_icons' => 1,

'wizards' => array(

...

),

)

),

...

If you want to know more about the configuration and possibilities of the uid_parent field, please refer to the manual of the cps_tcatree.

The form should look like in the illustration below now.

Frame3

Frontend works

HTML template

You have to add a table field marker to the HTML template within the search form section. See the line with the marker ###TX_GREENCARS_MANUFACTURER.TITLE### in the HTML snippet below.

wwwrun@s15315906: .../typo3conf/ext/green_cars> nano res/default.tmpl

...

<!-- ###SEARCHFORM### begin -->

<div class="searchbox searchbox-###VIEW###-###MODE###">

<form action="###ACTION###" method="post" >

<fieldset>

<legend>###MY_SEARCH_LEGEND###</legend>

<input type="hidden" name="no_cache" value="1" />

<input class="sword" type="text" name="tx_browser_pi1[sword]"onfocus="if(this.value =='###SWORD_DEFAULT###') this.value=''"value="###SWORD###" />

<input class="button" type="submit" value="###BUTTON###" />

<input class="reset" type="button"

onclick="location='###MY_URL###'" value="###MY_RESET###" />

<!-- Add filter with the ###TABLE.FIELD### syntax and configure your filter

with TypoScript -->

<br />

###TX_GREENCARS_MANUFACTURER.TITLE###

###TX_GREENCARS_TYPE.TITLE###

###TX_GREENCARS_ENGINE.TITLE###

###TX_GREENCARS_PRICEBRACKET.TITLE###

</fieldset>

...

TypoScript
Constants

Please configure some properties with the TypoScript Constant Editor.

Frame3

Modul > Web: Template

Page tree: Page with the tree view

Edit area: [Constant Editor]

Category [BROWSER – JQUERY JSTREE]

Theme

Name of the theme of tree views. Options are

  • [apple]
  • [classic]
  • [default]
  • [default-rtl]

Default is classic.

If you need different themes for different tree views, you can configure the theme of each tree view with the TypoScript setup.

See examples in section "Themes" on page 31 below.

Path to themes

Path to the folder, which contains the themes (with ending slash). Default is

typo3conf/ext/browser/res/js/jquery/plugins/jquery.jstree/themes/

If you like to have an individual theme, please link to the folder with your themes.

Plugins

The jQuery plugin jstree enables the tree view. JavaScript plugins are included while runtime. Depending on a category_menu or a checkbox different plugins are needed. You can choose between

  • [category menu]
  • [checkbox]

The default is checkbox.

If your tree view is a CATEGORY_MENU object, you must select [category menu], if it is a TREEVIEW, you have to select [checkbox]. You will receive a qualified error prompt in the frontend in case of a misconfiguration.

Selector 1

HTML id of the <div> tag of tree view. DON'T USE DOTS!

Default is tx-browser-pi1-jstree-01.

Recommended is something like yourtable_yourfield_01. I.e: tx_greencars_manufacturer_title

table.field of Selector 1

The table and field of your filter in the table.field syntax: Example: tx_greencars_manufacturer.title

BE AWARE: This value must (!) correspond with the used table.field in your TypoScript setup (see below).

Selector from 2 to 5

See Selector 1 above.

table.field of Selector from 2 to 5

See table.field of Selector 1 above.

Dots

Use dots. Default is 1.

Icons

Use icons. Default is 0.

Setup

You have to add a TypoScript configuration for the filter. filter.tx_greencars_manufacturer is added in the TypoScript snippet below.

wwwrun@s15315906: .../typo3conf/ext/green_cars> nano static/browser/setup.txt

...

plugin.tx_browser_pi1 {

...

views {

list {

1 {

...

filter {

tx_greencars_manufacturer {

title < plugin.tx_browser_pi1.displayList.master_templates.treeview

title {

first_item {

cObject {

20 {

data = LLL:EXT:green_cars/locallang_db.xml:filter_phrase.manufacturer

}

}

}

wrap = <div class="category_menu category_menu_treeview">|</div>

}

}

...

Result

The illustrations below displays an example with the tree view in the initial mode (collapsed) and after opening the folders "root" and the manufacturer "Volkswagen".

The design depends on your CSS.

Frame3 Frame3

Tree view in depth

Based on the jQuery plugin jsTree

The frontend functionality is based on the jQuery plugin jsTree.

If you are using a filter with the type CATEGORY_MENU or TREEVIEW in context with a table, which has a tree view, the TYPO3 Browser generates the tree view in the frontend automatically.

Automatically means: the Browser includes

  • the JSS script jsTree
  • an own script for controlling jsTree

jsTree has a lot of features.

jsTree homepage

If you want to know more about jsTree, please refer to

http://www.jstree.com/

Cookies

The Browser provides jsTree supported by cookies. If a user has left a website with jsTree and visits it again, the tree view will have the same status like the last visit.

This is important in another context. If a user has selected an item of the jsTree and the page is loaded again, the jsTree isn't collapsed but has the previous status.

Themes

Provided themes

jsTree provides four themes by default:

  • apple
  • classic
  • default
  • default-rtf (rtf means right to left. Some languages will be written from right to left).
CATEGORY_MENU

Frame3 Frame3 Frame3 Frame3

The illustration on the right hand displays the classic theme but without icons and without hits.

TREEVIEW

Frame3

The illustration above displays the classic theme but without icons and without hits.

Of course the themes apple and default are supported too, but they aren't displayed here.

Select a provided theme

Please choose a provided theme by the TypoScript Constant Editor. See "TypoScript Object Browser" on page 17 above.

If you have an individual theme, please configure the property in the setup directly. See

plugin.tx_browser_pi1.javascript.jquery.plugins.jstree.library.marke r.theme.value = apple

Own theme

You may design your own theme. You have to place the theme or themes in a folder of your choice. Than configure the path to this folder by the TypoScript Constant Editor.

See "TypoScript Object Browser" on page 17 above.

More than one tree view

You can use the tree view unlimited. But only five tree views are prepared by the TypoScript Constant Editor.

Controlling by the HTML id

A tree view is controlled by the HTML id. The Browser filter module has prepared five ids.

They are configurable by the TypoScript Constant Editor, because the ids are used in the TypoScript at several properties.

TypoScript Object Browser

Frame3

If you use a second filter as a tree view menu, please move the html_id from ...01 to ...02. See the snippet below.

plugin.tx_browser_pi1 {

views.list.1.filter {

your_table {

your_field {

treeview {

html_id {

value = {$plugin.tx_browser_pi1.jQuery.plugin.jstree.selector_ 02 }

}

}

}

}

}

}

Same procedure for any other tree view. Please use

  • ...03
  • ...04
  • ...05

If you aren't familiar with TypoScript constants, please refer to the paragraph below.

TypoScript Constant Editor

Frame3

Usually there isn't any need to change an id for a tree view. If you have special needs for CSS, it is recommended to change the id supported by the TypoScript Constant Editor, but not by the TypoScript Object Browser.

Disable the tree view / top level only

If you don't want to use the tree view in the frontend, you can disable it. The snippet is an example for a list with the number one and a filter with the table field tx_greencars_manufacturer.title.

It is recommended to display only the top level of the category table. You configure it with a SQL andWhere.

plugin.tx_browser_pi1 {

views {

list {

1 {

filter {

tx_greencars_manufacturer {

// Disable the tree view

title.treeview.enabled.value = 0

// Enable top level only

sql.andWhere = tx_greencars_manufacturer.uid_parent = 0

}

}

}

}

}

}

Frame3 Frame3

How to add an own script?

The Browser adds a short JSS script for controlling the jsTree plugin.

If there is any need to use an own script, please configure the array:

plugin.tx_browser_pi1 {

javascript {

plugins {

jstree {

...

}

}

}

}

}

Use marker in your script

If you are using an own script, there will be the need to replace marker while runtime too. You can replace any marker in your JSS script. See the marker section in

plugin.tx_browser_pi1.javascript.jquery.plugins.jstree.library.marke r

Every marker is a COA. For example: the TypoScript marker "your_marker" will replace the string ###YOUR_MARKER### in your JSS file.

Restrictions

Five tree view per page are applicabled

The TYPO3 Browser is applicabeld for five tree views per page.

Applicabeld means:

  • TypoScript is prepared
  • jQuery is prepared

If you like to use more than five tree views per page, you have to extend TypoScript and jQuery. But sorry: this isn't part of this tutorial.

More than one tree view per page

You have to take care for the id of the div wrap of the tree view by your own. You have to update or extend the CSS for the jstree id.

No path is calculated

You have to allocate an item to the category, each node and the root.

Example:

You have a database with cars and a category tree like

manufacturer [root]

model [node]

car parts [category]

You like to categories a rear brake for a Volkswagen Golf V.

You have to allocate the item to the root, each node and the category:

Volkswagen [id 37]

Golf V [id 1423]

breaks [id 23412]

The parent uid field of the item must contain the ids 37, 1423, 23412 (the order is unimportant and it hasn't any effect for the frontend).

Performance

This restriction is caused because of performance.

The Browser is able to filter all records of the database with one SQL query only.

Without all ids of the category path, it would be a need, to calculate the category path for each record while runtime. You will need a SQL query for each record in a worst case: If you have 16.000 records, you will have 16.000 SQL queries.

Known bugs, unproper usability

AJAX

Don't use AJAX. You will get unexpected results.

Please disable AJAX in the plugin/flexform of the Browser tab [jQuery & AJAX].

Cookies
Without static url or without real url

jsTree is using cookies. If you use tree views on different pages without static url or real url, all pages will have the same adress like index.php. Different jsTrees can get the same cookie, jsTree can't differ between this jsTrees (tree views). Solution is to adapt the used JavaScript code – here: the configuration of the cookies plugin.

Reload of the page

If the user reloads the current page, page is loaded without former filter criteria. But tree views will display former filter criteria because of the cookies memory. This effect can confuse the visitor of your website.

More examples

Quick Shop - 1 Filter

It is very simple to configure the content objects

  • SELECTBOX
  • CHECKBOX and
  • RADIOBUTONS

All have a master template. You copy the master template to your view and you configure the properties only, which aren't configured for your needs.

If you are interested in the power of a master template, please look at

Reference 'SELECTBOX' on page 55 below

After copying you will see the powerful TypoScript code supported by the TypoScript Object Browser in your view array. It should be comprehensible, how to change any feature and property of your filter to your needs.

See section

  • 'TypoScript Object Browser' on page 17 above and
  • Reference 'master_templates' on page 53 below

See the examples below.

SELECTBOX

Frame3

See the TypoScript on the next page.

TypoScript

See the line

// The filter becomes the property SELECTBOX

below in the snippet

plugin.tx_browser_pi1 {

...

views {

list {

1 {

select = ...

filter {

tx_quickshop_categories {

// The filter becomes the property SELECTBOX

title < plugin.tx_browser_pi1.displayList.master_templates.selectbox

title {

// Configuration SELECTBOX begin

first_item {

stdWrap {

data >

value = Select a Category

lang {

de = Kategorie wählen

}

}

}

wrap = <span class="selectbox">|</span>

wrap {

item {

stdWrap {

crop = 60 | ... | 1

}

}

}

// Configuration SELECTBOX end

}

}

}

}

}

single {

...

}

}

}

Easy way of configuring: See section 'TypoScript Object Browser' on page 17 above.

CHECKBOX

Frame3

TypoScript

See the line

// The filter becomes the property CHECKBOX

below in the snippet

plugin.tx_browser_pi1 {

...

views {

list {

1 {

...

filter {

tx_quickshop_categories {

// The filter becomes the property CHECKBOX

title < plugin.tx_browser_pi1.displayList.master_templates.checkbox

}

}

}

}

}

}

RADIOBUTTONS

Frame3

TypoScript

See the line

// The filter becomes the property RADIOBUTONS

below in the snippet

plugin.tx_browser_pi1 {

...

views {

list {

1 {

...

filter {

tx_quickshop_categories {

// The filter becomes the property RADIOBUTONS

title < plugin.tx_browser_pi1.displayList.master_templates.radiobutons

}

}

}

}

}

}

Green Cars - Dynamic Filter

The Browser filters are dynamically by default. This means:

  • If a filter item hasn't any hit, it won't be displayed.
  • Each filter controls all others..
Exercise

We will change some TypoScript of the page http://gruene-autos.org/ for demonstration only.

See the examples below.

SELECTBOX (Default)

Frame3

This is the start page of http://gruene-autos.org/

It has three filters designed as selectboxes. Each displays one item only (HTML property size is 1).

The TypoScript for the three selectboxes should be clear (see the snippet below).

TypoScript

See the lines

// This filter becomes the property SELECTBOX

below in the snippet

plugin.tx_browser_pi1 {

...

views {

list {

1 {

select = ...

filter {

tx_greencars_engine {

// This filter becomes the property SELECTBOX

title < plugin.tx_browser_pi1.displayList.master_templates.selectbox

title {

first_item {

stdWrap {

data = LLL:EXT:green_cars/locallang_db.xml:tx_greencars_main.engine

}

}

wrap = |

}

}

tx_greencars_pricebracket {

// This filter becomes the property SELECTBOX

title < plugin.tx_browser_pi1.displayList.master_templates.selectbox

title {

first_item {

stdWrap {

data = LLL:EXT:green_cars/locallang_db.xml:tx_greencars_main.pricebracket

}

}

wrap = |

order {

field = uid

}

}

}

tx_greencars_type {

// This filter becomes the property SELECTBOX

title < plugin.tx_browser_pi1.displayList.master_templates.selectbox

title {

first_item {

stdWrap {

data = LLL:EXT:green_cars/locallang_db.xml:tx_greencars_main.type

}

}

wrap = |

}

}

}

}

}

}

}

SELECTBOXES size = 5

For a better understanding of dynamic filters we change the properties of each selectbox. We like to display five items per box and we remove the title (the first item). See the illustration below.

Frame3

TypoScript

// Set the size of all boxes to 5

plugin.tx_browser_pi1.views.list.1.filter.tx_greencars_engine.titl e.size = 5

plugin.tx_browser_pi1.views.list.1.filter.tx_greencars_pricebracke t.title.size = 5

plugin.tx_browser_pi1.views.list.1.filter.tx_greencars_type.title. size = 5

// Don't display the first_iem

plugin.tx_browser_pi1.views.list.1.filter.tx_greencars_engine.titl e.first_item = 0

plugin.tx_browser_pi1.views.list.1.filter.tx_greencars_pricebracke t.title.first_item = 0

plugin.tx_browser_pi1.views.list.1.filter.tx_greencars_type.title. first_item = 0

Selection Case

We are interested in cars

  • with a diesel or domestic gas engine
  • with a price-bracket from 20.000 EUR to 25.000 EUR

Frame3

If you like, that the values in the boxes will changed after sending the form, please setting up in the flexform in the tab [List view] the field "Total hits" to [Controlled by selected filters].

You will have this behaviour:

  • every item has a new number of hits
  • there are some items without any hit and they won't be displayed like
    • Coupe
    • all engines without a selection (of course)
    • all price-brackets without a selection (of course)

Frame3

Change the Behaviour
Display price-brackets even if they haven't any hit

Frame3

TypoScript

// Display price-brackets even if they haven't any hit

plugin.tx_browser_pi1 {

views.list.1.filter.tx_greencars_pricebracket.title.wrap.item.displa y_without_any_hit = 1

}

Display price-brackets without the number of hits

Frame3

TypoScript

// Display price-brackets without the number of hits

plugin.tx_browser_pi1 {

views.list.1.filter.tx_greencars_pricebracket.title.wrap.item.displa y_hits = 0

}

Organiser - Filter for a period (data area)

This is a typical example for a calendar.

This is the case:

  • dates of events are stored in a field "datetime"
  • the format of a date is a timestamp
  • the table tx_org_cal contains the field datetime. The table.field- syntax is: tx_org_cal.datetime
Preconditions

We have configured a list view (and a single view of course) for the table tx_org_cal.

HTML Template

We have added the marker ###TX_ORG_CAL.DATETIME### to our HTML template into the filter section.

See section HTML Template on page 15 above.

TypoScript Snippet SELECTBOX

plugin.tx_browser_pi1 {

views {

list {

201 {

name = Calendar

select (

tx_org_cal.title,

tx_org_cal.datetime

)

csvLinkToSingleView = tx_org_cal.title

filter {

tx_org_cal {

datetime < plugin.tx_browser_pi1.displayList.master_templates.selectbox

}

}

}

}

...

}

}

Result in the Frontend

Frame3

Comment

Line 11 to 13 (see page above): we allocates a filter for tx_org_cal.datetime in form of a SELECTBOX.

The items of the SELECTBOX are in our case:

<option value="1283968800">1283968800 (2)</option>

<option value="1304892000">1304892000 (1)</option>

<option value="1315591200">1315591200 (3)</option>

This means:

We have two dates at 1283968800, one date at ... and three dates at ...

But we don't want for every date an item in the selectbox. We want something like "Display the events of the last year, this year and the next year".

We want something like this:

<option value="10">2009 (0)</option>

<option value="20">2010 (2)</option>

<option value="30">2011 (4)</option>

We add an area out of the master template section and configure some properties.

TypoScript Snippet with Area

plugin.tx_browser_pi1 {

views {

list {

201 {

name = Calendar

select (

tx_org_cal.title,

tx_org_cal.datetime

)

csvLinkToSingleView = tx_org_cal.title

filter {

tx_org_cal {

datetime < plugin.tx_browser_pi1.displayList.master_templates.selectbox

datetime {

// Every item should be displayed even though it hasn't any hit

wrap.item.display_without_any_hit = 1

// Order the items by uid (and not by value)

order.field = uid

// Allocates the master template sample_period

area < plugin.tx_browser_pi1.displayList.master_templates.areas.sam ple_period

}

}

}

}

}

...

}

}

Comment

Line 16: Every item should be displayed even though it hasn't any hit

Line 18: Order the items by uid (and not by value)

Line 20: This is the most important line. We allocate the master template sample_period.This template provides by default:- a period of years- a period from last year to next year (be aware of the relative period!)- and the items are formatted as year only.

Every property is configurable.

We get, what we want:

<option value="10">2009 (0)</option>

<option value="20">2010 (2)</option>

<option value="30">2011 (4)</option>

Properties and Possibilities

Please refer to the Reference AREAS on page 58 below.

Condition for a Filter

Each filter has the property condition. condition is a cObject. By default the condition is met.

TypoScript Default Code

// If condition is met, filter will display. If not, filter will hide.

condition = TEXT

condition {

// True (default)

value = 1

}

Example

The extension Organiser (extKey: org) provide documents for downloading. There are two steps for selecting an document:

The visitor has to select a category before viewing a list

The list has a category filter, but it shouldn't displayed if a category was selected before

We configure the condition like in the TypoScript snippet below:

  • Line 11-12: We remove the default condition property and define a new condition property as a COA
  • Line 14-31: The COA has two elements. Both elements have an if property.The if property checks if there is the global parametertx_browser_pi1[tx_org_downloadscat.title][0].. This parameter will sent, if a category is selected.If a category is selected (if.isTrue), the COA will return 0, any filter won't display.If any category is selected (if.isFalse), the COA will return 1, the filter will display.
TypoScript Snippet

plugin.tx_browser_pi1 {

views {

list {

301 = +Org: Downloads

301 {

...

filter {

tx_org_downloadscat {

title < plugin.tx_browser_pi1.displayList.master_templates.selectbox

title {

condition >

condition = COA

condition {

10 = TEXT

10 {

value = 0

if {

isTrue {

data = GPvar:tx_browser_pi1|tx_org_downloadscat.title|0

}

}

}

20 = TEXT

20 {

value = 0

if {

isFalse {

data = GPvar:tx_browser_pi1|tx_org_downloadscat.title|0

}

}

}

}

...

Configuring hits

The difference between counting and displaying

The Browser is counting hits and display it.

The display is depending on counting of course.

If you have configured, that items without any hit will displayed and you disable the counting of hits, no filter won't displayed!

Performance

Counting of hits costs performance. If you have a lot of filter and a lot of records, please disable the counting of hits (see below).

Disable counting

If you have a lot of data and a lot of category tables with a lot of items, the counting of hits can cost performance. :sup:`0 <#sdfootnote7sym>`_

You can disable and enable the counting of hits per each filter in the TypoScript. See the example below.

plugin.tx_browser_pi1 {

views.list.1.filter. table.field {

count_hits = 0

}

}

table.field: table is the category table like tt_news_cat. field is the label of the field like title.

All filter items will displayed by default

If counting is disabled, all filter items will displayed by default. Each filter has the property

wrap.item.displayInCaseOfNoCounting

If this property is enabled, each filter row get a flag. You can disable this behaviour. Set displayInCaseOfNoCounting to 0.

plugin.tx_browser_pi1 {

views.list.1.filter. table.field {

count_hits = 0

...

wrap {

item {

displayInCaseOfNoCounting = 0

}

}

}

}

cObject

From Browser version 4 filter have the cObject property:

// cObject for the first filter item

filter.tx_greencars_engine.title.first_item.cObject

// cObject for filter items

filter.tx_greencars_engine.title.wrap.item.cObject

TYPO3 integrators are more flexible now.

Display conditions for a filter item

The cObject has an if property with three OR conditions by default.

A filter item will displayed:

if it has one hit at least or

if counting is disabled (see "Performance" on page 49 above) or

if the current filter is a treeview

plugin.tx_browser_pi1 {

views.list.1.filter. table.field {

...

wrap {

item {

cObject = COA

cObject {

...

if {

isTrue {

// Display with hits only or in case of a tree view

cObject = COA

cObject {

10 = TEXT

10 {

field = hits

}

20 = TEXT

20 {

field = tx_browser_pi1.flag_displayInCaseOfNoCounting

}

30 = TEXT

30 {

field = tx_browser_pi1.flag_treeview

}

}

}

}

wrap = <a href="###URL###"###CLASS######STYLE######TITLE###>|</a>

}

}

}

}

}

You can disable it: remove if.isTrue.cObject.10 or 20 or 30 or all.

The "no value" label

The cObject has the two elements 20 and 21 by default.

cObject.20 will displayed, if there is an value.

cObject.21 will displayed, if there isn't any value.

plugin.tx_browser_pi1 {

views.list.1.filter. table.field {

...

wrap {

item {

cObject = COA

cObject {

// Value in case of a value

20 = TEXT

20 {

if {

isTrue {

field = value

}

}

field = value

htmlSpecialChars = 1

crop = 60 | ... | 1

}

// Value in case of no value

21 = TEXT

21 {

if {

isTrue {

field = value

}

negate = 1

}

data = LLL:EXT:browser/pi1/locallang.xml:label_categorymenu_noValue

}

}

}

}

}

}

Replace values

TYPO3 integrators are able, to replace special values. This could be an example: replace Audi, Seat and Skoda with "VW Group".

You have to configure a TEXT object with the proper if. But this isn't part of this tutorial.

Configure or disable hits

If an item has one hit at least, it will extended with something like "(4)" in case of four hits. If you want to disable or change it, please edit cObject.30.

plugin.tx_browser_pi1 {

views.list.1.filter. table.field {

...

wrap {

item {

cObject = COA

cObject {

...

// Hits

30 = TEXT

30 {

if {

// Display hits only in case of one hit at least

isTrue {

field = hits

}

}

field = hits

noTrimWrap = | (|)|

}

}

}

}

}

}

If you like to prepend the hit result for example, please move cObject.30 to cObject.10.

Reference

This tutorial provides only the reference for the master_template array (see below)

You find all other stuff in the manual of the Browser:

master_templates

All master_templates are local. You have to copy the template to your view and configure it there.

See the example below.

master_templates

Property

master_templates

Data type

array

Description

Configuration of master templates for the filter.

Content Objects are

  • CATEGORY_MENU
  • CHECKBOX
  • RADIOBUTTON
  • SELECTBOX
  • TREEVIEW

Code:

plugin.tx_browser_pi1 {
  displayList {
    master_templates {
      selectbox = SELECTBOX
      selectbox {
        ...
      }
    }
  }
}

Example:

plugin.tx_browser_pi1 {
  views {
    list {
      1 {
        select (
          fe_users.last_name,
          fe_users.first_name,
          fe_users.image,
          fe_groups.title,
          tx_org_management.title
        )
        filter {
          fe_groups {
            title < plugin.tx_browser_pi1.\
                    displayList.\
                    master_templates.selectbox
            title {
              first_item {
                stdWrap {
                  data >
                  value   = All Groups
                  lang.de = Alle Gruppen
                }
              }
              wrap = \
                <span class="selectbox">|</span>
              wrap {
                item {
                  stdWrap {
                    crop = 30 | ... | 1
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

Default

CATEGORY_MENU

Display your filter as a HTML category menu.

The subpart ###CATEGORY_MENU### is disabled by TypoScript by default. The subpart will removed from the HTML template – you won't have any waste in your code.

If you are using the category menu please enable in your global or local configuration:

displayList.display.category_menu = 1

CATEGORY_MENU

Property

CATEGORY_MENU

Data type

array

Description

Content Object CHECKBOX

Example:

See Code of SELECTBOX below

Default

CHECKBOX

Display your filter as a HTML check box.

CHECKBOX

Property

CHECKBOX

Data type

array

Description

Content Object CHECKBOX

Example:

See Code of SELECTBOX below

Default

RADIOBUTTONS

Display your filter as HTML radio buttons.

RADIOBUTONS

Property

RADIOBUTONS

Data type

array

Description

Content Object RADIOBUTONS

Example:

See Code of SELECTBOX below

Default

SELECTBOX

SELECTBOX

Property

SELECTBOX

Data type

array

Description

Content Object SELECTBOX

Example:

See Code below

Default

plugin.tx_browser_pi1 {
  displayList {
    master_templates {
      selectbox = SELECTBOX
      selectbox {
          // If condition is met, filter will display. If not, filter will hide.
        condition = TEXT
        condition {
            // True (default)
          value = 1
        }
        // [String/optional] Name for the piVar. Name must be unique.
        nice_piVar =
        // [String] OR || AND: OR (default)
        modeAndOr = OR
        // [Boolean] Should be added a default item?
        first_item = 1
        first_item {
          // [Boolean] 0: Item without any hit will not be displayed. 1: Any item will be displayed.
          display_without_any_hit = 1
          // [Boolean] 1: Items display the number of hits. 0: Items doesn't display any number of hits.
          display_hits = 0
          display_hits {
            // [Boolean] 1: Hits are displayed behind the item. \
                         0: Hits are displayed in front of the item.
            behindItem = 1
            stdWrap {
              noTrimWrap = | (|)|
            }
          }
          stdWrap {
            data = LLL:EXT:browser/pi1/locallang.xml:label_filter_firstitem_default
          }
          // [STRING, unique] Value attribute in the option tag (#11401)
          option_value = 0
        }
        // [Boolean] Should it be possible to select more than one item?
        multiple  = 0
        multiple {
          // [String] HTML code for multiple
          selected = multiple="multiple"
        }
        // [Integer] How many items should the select box display in the visible area?
        size = 1
        // [String] Wrap the object
        wrap = <div class="selectbox">###TITLE###|</div>
        wrap {
          // [Integer] Space characters from left margin in the HTML code
          nice_html_spaceLeft = 12
          title_stdWrap {
            // [String] Title of the object. If it shouldn't display, please delete the title array
            value = ###TABLE.FIELD###
            wrap  = <div class="selectbox_title">|</div>
          }
          // [String] Wrap the items
          object = \
            <select name="###TABLE.FIELD###" id="###ID###" size="###SIZE###"###MULTIPLE###>|</select>
          object {
            // [Integer] Space characters from left margin in the HTML code
            nice_html_spaceLeft = 14
          }
          // [String] Wrap one item
          item    = <option###CLASS######STYLE### value="###UID###"###ITEM_SELECTED###>|</option>
          item {
            // [Boolean] 0: Item without any hit will not be displayed. 1: Any item will be displayed.
            display_without_any_hit = 0
            // [Boolean] 1: Items display the number of hits.\
                         0: Items doesn't display any number of hits.
            display_hits = 1
            display_hits {
              // [Boolean] 1: Hits are displayed behind the item. \
                           0: Hits are displayed in front of the item.
              behindItem = 1
              stdWrap {
                noTrimWrap = | (|)|
              }
            }
            // [Integer] Space characters from left margin in the HTML code
            nice_html_spaceLeft = 16
            // [String] HTML code for a selected item
            selected = selected="selected"
            // [String] Default HTML class
            class =
            // [String] Default HTML style
            style =
            stdWrap {
              htmlSpecialChars = 1
              crop             = 60 | ... | 1
            }
          }
        }
        order {
          // [String] value || uid
          field = value
          // [String] ASC || DESC
          orderFlag = ASC
        }
        sql {
          // [String, SQL] And where statement. Example: \
               tt_news_cat.author.field LIKE 'A%' AND tt_news.uid < 99
          andWhere =
        }
        // [BOOLEAN] You have to allocate one of the areas of the master template.
        area = 0
      }
    }
  }
}

TREEVIEW

Display your filter as HTML radio buttons.

RADIOBUTONS

Property

RADIOBUTONS

Data type

array

Description

Content Object TREEVIEW

Example:

See Code of SELECTBOX above

Default

filter condition

filter. table.field. condition

Property

filter. table.field. condition

Data type

cObject

Description

Define a condition for displaying or hiding your Browser plugin.

Examples:

  • See "Condition for a Filter" on page 47 above
  • See Code below

Default

plugin.tx_browser_pi1 {

views {

list {

1 {

filter {

your_table {

your_field < plugin.tx_browser_pi1.displayList.master_templates.selectbox

your_field {

// Remove the default condition

condition >

// Define your own condition

condition = COA

condition {

// See "Condition for a Filter" on page 47 above

AREAS

Areas contains master templates for area samples. Samples are

  • currency

    hard coded

  • period

    • hard coded
    • relative

Areas are limited to integers and numbers.

We intend to extend it for chars and strings too :sup:`0 <#sdfootnote8sym>`_ .

You need a content object SELECTBOX, CHECKBOX or RADIOBUTTONS from above, if you like to use an area filter.

areas

Property

areas

Data type

array

Description

Configuration array for an area. You need it, if you like to filter data areas

Default code:

plugin.tx_browser_pi1 {
  displayList {
    master_templates {
      areas {
        sample_currency = 1
        sample_currency {
          strings = 1
          strings {
            // Configuration for a hard coded
            // currency area
          }
        }
        sample_period = 1
        sample_period {
          strings = 0
          strings {
            // Configuration for a hard coded
            // period
          }
          interval = 1
          interval {
            // Configuration for a relative period
          }
        }
      }
    }
  }
}

Default

Example

Please refer to the section Organiser - Filter for a period (data area) on page above.

TypoScript Object Browser

Please use the TypoScript Object Browser, if you like to inspecting all properties.

Possibilities

See examples below.

AREA - Period interval

Period interval is a smart tool: Period interval enables you to define relative periods like

  • display all seven days of the current week
  • display four weeks from one week ago
  • display alls months of the current year
  • display all years from last year to next year

If you want to play with the examples, please change the case property like this:

plugin.tx_browser_pi1.displayList.master_templates.areas {

sample_period.interval.case = week

}

areas

Property

areas

Data type

array

Description

Configuration array for an area. You need it, if you like to filter data areas

Default code:

plugin.tx_browser_pi1 {
  displayList {
    master_templates {
      areas {
        sample_period = 1
        sample_period {
          interval = 1
          interval {
            // [BOOLEAN]: 1: dates are converted to\
                          timestamp. 0: undefined
            compare_wiTimeStamp = 1
            // [STRING] day, week, month, year
            case = year
            day {
              // Configuration for days
            }
            week {
              // Configuration for weeks
            }
            month {
              // Configuration for months
            }
            year {
              // Configuration for years
            }
          }
        }
      }
    }
  }
}

Default

Day

See year below.

Week

See year below.

Month

See year below.

Year

Every period has the properties:

  • start_period
  • times_stdWrap
  • value_stdWrap

Please inspect the TypoScript snippet below too become familiar with the properties and possibilities.

year {

start_period {

// [BOOLEAN] 1: Value is handled after stdWrap with php strtotime. 0: stdWrap only.

use_php_strtotime = 1

stdWrap {

// Examples with strtotime: -1 year, 2010, now, next year

value = -1 year

}

}

times_stdWrap {

// [INTEGER] Display the period n times

value = 3

}

value_stdWrap {

// [STRING] Leave it empty! It will be handled while runtime.

value =

// [STRING] See php method strftime

strftime = %Y

}

get_param {

// PHP date format: Please use numbers only! Y example: 2011

date_format = Y

}

}

Example

Please refer to the section Organiser - Filter for a period (data area) on page above.

AREA - Period hard coded

It is possible to "hard code" a period too. See the example in

plugin.tx_browser_pi1.displayList.master_templates.areas {

sample_period.string {

...

}

}

AREA - Currency hard coded

It is possible to "hard code" an area of numbers too. See the example in

plugin.tx_browser_pi1.displayList.master_templates.areas {

sample_curreny.string {

...

}

}

What's new in Version 4?

Filter: AND

[4.8.8]

Filter items can queried by OR and AND. See new TypoScript property filter.table.field.modeAndOr at "SELECTBOX" on page 55 above.

Option isn't tested in localised context

Filter: Checkboxes for Selectbox

[4.8.8]

If you are using a selectbox in the backend, you can render the items both ways in the frontend:

  • as selectbox or
  • as checkboxes.

Filter: cObject

[3.9.16]

Filter are a cObject. See "cObject" on page 50 above.

Filter: conditions

[3.9.3]

You can define a display condition for a filter.

Example for a requirement

You have the work flow:

  • The visitor has to select a category before viewing a list
  • The list shouldn't contain the category filter, if a category was selected before

See "Condition for a Filter" on page 47 above.

Filter: radial search (de: Umkreissuche)

[4.7.0]

You can display a category menu as tree view.

You need the extension cps_tcatree. This extension enables to order items in a tree view in the TYPO3 backend.

See "Tutorial Radial Search (Umkreissuche)" on page 18 above.

Filter: tree view

Category Menu

[3.9.6]

You can display a category menu as tree view.

You need the extension cps_tcatree. This extension enables to order items in a tree view in the TYPO3 backend.

See "Tutorial tree view" on page 21 above.

Checkbox

[4.1.21]

You can display a checkbox as tree view.

You need the extension cps_tcatree. This extension enables to order items in a tree view in the TYPO3 backend.

See "Tutorial tree view" on page 21 above.

What's new in Version 3.6?

Area and interval: get parameters with date

[3.6.4]

Links of this menu "Calendar | March | April" will be now:

See reference:

get_param.date_format

Category Menu

[3.6.0]

You can filter your data by a category menu. The difference between a category menu and the available filters check box, radio buttons and select box is, that the first is a list of links and all others are a part of an HTML form.

You can use areas for a category menu in the same way like for filters.

Configurable: Search respects Filters

[3.6.0]

It is configurable, if the search respect filters. It is possible to differentiate between every filter.

The new TypoScript property is

plugin.tx_browser_pi1.displayList.display.searchform.respect_filter s

Filter for areas

[3.6.0]

You can filter your data by areas. Example for areas are

  • 2010 to 2012
  • 10.000 EUR to 20.000 EUR

You can generate filter for periods relative like:

  • all days of the current week
  • -2 weeks from now to +2 weeks from now

Filter for local table

[3.6.0]

You can filter data from the local table. Before version 3.6.0 it was possible to filter data of foreign tables only.

Helpful suggestions

Forum

img-7 Illustration 52: 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

dorn & malag

Thanks to

dorn & malagagentur fürs netz http://www.dorn-malag.de/

who sponsored a part of the features CHECKBOX and RADIOBUTTONS.

Frame3

LEG Thüringen

Thanks to

LEG Thüringen http://leg-thueringen.de/

who sponsored

  • a part of the feature to filter data in local tables
  • improvement of performance
  • integration of jsTree (tree view)

Frame3

To-Do List

Nothing to do.

Known bugs

Please refer to the "Known bugs, unproper usability" within the section tree view on page 36 above.

Change Log

4.8.8 Features * #56329: AND option for filter* New TypoScript property filter.table.field.modeAndOr* Option isn't tested in localised context

4.7.0 Feature * #52486: Radial Search

4.1.21: New Feature * #41753: Treeview as checkbox* #41753.01: New COA TREEVIEW Improvement * #41754: Filter: optimise performanceCHECKBOX is enabled for treeviews* #41754.01: $arr_andWhereFilter isn't never allocated* #41754.02: init_aFilterIsSelected (boolean) is moved to get_selectedFilters (array)* #41754.03: SQL optimisation: new method sql_resAllItemsFilterWoRelation( )* #41754.04: Improve performance reportsBE AWARE: It isn't tested in localised context* #41776: Make filter 4.x independent of filter 3.x Bugfix * #41814: Filter: local table isn't proper, if hits aren't displayed* #41811: Filter areas: last item doesn't count hits

4.1.19 Development * #00000: Treeview Checkboxes

4.1.18 Improvement * #00000: jsTree: non used files and folders are removedjsTree TypoScript Constant Editor: dots and icons* #00000: res/js/jquerytx_browser_pi1_jstree-3.9.21.js is moved to tx_browser_pi1_jstree-4.1.18.js

4.1.16 Bugfix * #00000: Filter areas: If any filter is matched in localised context, alls records were displayed* #00000: Filter weren't displayed in case of any record doesn't matched

4.1.15 Improvement * #41372: Filter areas: strings aren't supported proper

4.1.12 Bugfix * #11401: Filter: ###UID### replacement depends on localtable or foreigntable

4.1.10 Bugfix * #00000: * SearchForm: remove hiddden field for plugin4.1.7 Bugfixes * #40354: Checkbox without input-tag* #40354: Checkbox and radiobuttons* items without proper line breaks* items without a name* items without hits

4.1.4 New Feature * #00000: Filter for map

4.0.0 Publishing * #00000: Release 4.0.0

3.9.22 Improvement #00000: optimising five tree views

3.9.21 Improvement #00000: enable more than one tree view by default

3.9.20 Improvement #00000: tree view performance

3.9.19 Bugfix #00000: andWhere search -> trim tableFields

3.9.18 Bugfix #00000: andWhere is ignored

3.9.16 Bugfix #00000: First filter item counts hitsFirst filter item counts hits in the tree view proper

3.9.9: New Feature * #33826: filter becomes cObject

3.9.6: New Features - #32223: Category tree- #30912: Filter: independent total hits

3.9.3: New Features - #32117: Condition for filters

3.6.0: New Features - #11580: Configurable: Should the search respect filters?- #11523: Hide the update report for public- #11402: Filter for areas- #11401: Filter for local table- #8807: Category Menu

3.5.0: New Features - #8335: Filter with multiple select- #8337: Filter with checkbox and radiobuttons- #9408: Display the number of hits in the filter items

3.4.0: Update Conditions for filtering

3.0.4: Update Filters are documented

3.0.3: Update Plugin has new properties for the search form.

3.0.1: Publishing

2.6.1: Initial release

Illustration Index

Illustration 1: Result with six search words 3

Illustration 2: tree view and select boxes on http://gruene-autos.org/ 3

Illustration 3: tree view is animated 4

Illustration 4: Filter can control itselfs: items without any hit will hidden. 4

Illustration 5: Example with check boxes. 5

Illustration 6: Example for a category menu and an area 5

Illustration 7: Treeview in the backend 5

Illustration 8: Tutorial in PDF format 6

Illustration 9: Frontend with a simple example with tt_news 7

Illustration 10: List view with marked search words 8

Illustration 11: Single view with marked search words 8

Illustration 12: List view with marked search words 8

Illustration 13: Single view with marked search words 8

Illustration 14: List view with marked words and phrases 9

Illustration 15: Single view with marked words and phrases 9

Illustration 16: The Browser plugin. Tab [List] (1) with the search menu (2) 10

Illustration 17: List view with the search form 11

Illustration 18: List view without any search form 11

Illustration 19: Search form with result phrase 11

Illustration 20: Search form without any result phrase 11

Illustration 21: http://gruene-autos.org/ with three selectboxes 15

Illustration 22: The object SELECTBOX 17

Illustration 23: The object SELECTBOX with some properties. 17

Illustration 24: Tree view example 21

Illustration 25: Installing cps_tcatree 22

Illustration 26: Update your extension. The field uid_parent will added to the SQL table 24

Illustration 27: Manufacturer table with the uid_parent field 24

Illustration 28: Tree view with manufacturers and models in the backend 25

Illustration 29: Tree view - local table with the category field 26

Illustration 30: Configuration of a treeview in the TypoScript Constant Editor 27

Illustration 31: Tree view - collapsed 29

Illustration 32: Tree view - opened 29

Illustration 33: Apple 31

Illustration 34: Classic 31

Illustration 35: Default 31

Illustration 36: Classic without icons 31

Illustration 37: Classic without Icons 31

Illustration 38: Tree view id property of a filter 32

Illustration 39: Tree view ids from 1 to 5 33

Illustration 40: Disabled tree view 34

Illustration 41: Disabled tree view with top level only 34

Illustration 42: Quick Shop with the filter SELECTBOX 37

Illustration 43: Quick Shop with the filter CHECKBOX 39

Illustration 44: Quick Shop with the filter RADIOBUTONS 40

Illustration 45: Green Cars with three selectboxes - each with size = 1 41

Illustration 46: Green Cars with three selectboxes - each with size = 1 42

Illustration 47: Green Cars with three selectboxes - each with size = 1 43

Illustration 48: Green Cars with three selectboxes - each with size = 1 43

Illustration 49: Green Cars with three selectboxes - each with size = 1 44

Illustration 50: Green Cars with three selectboxes - each with size = 1 44

Illustration 51: Calendar with select box 45

Illustration 52: The TYPO3-Frontend-Engine Browser Forum 64

Illustration 53: http://www.dorn-malag.de/ 65

Illustration 54: http://leg-thueringen.de/ 65

0 You can take every other extension, but than you need a TypoScript with its tables and fields instead of tt_news.

0 The Browser has a Geo Coding support.

0 The static template of Radial Search (Umkreissuche) must be included before the static template of the Browser – TYPO3 without PHP

0 501 is an example only. 501 is the view of the Organiser – TYPO3 for the lobby and the organisers – for headquarters records

0 Postal codes of the world: 1 177 212 exactly in October of 2013

0 Postal codes of Germany: 16 481 exactly in October of 2013

0 If you want to know more about performance, you can enable the DRS performance report in the extension manager.

0 We like a contract. Do you know someone for contracting?

71