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 |
extKey: browser_tut_search_en
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.
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
What does the Browser Search and Filter do? 6
Configuring the search form 10
Tutorial filters and a category menu 14
Tutorial Radial Search (Umkreissuche) 18
Hierarchical list, hierarchical checkbox 21
What does this tutorial do? 21
Extending the SQL table manufacturer 22
Extending the TCA configuration 23
Based on the jQuery plugin jsTree 30
Disable the tree view / top level only 34
Known bugs, unproper usability 36
Green Cars - Dynamic Filter 41
Organiser - Filter for a period (data area) 45
The difference between counting and displaying 49
Display conditions for a filter item 50
Filter: Checkboxes for Selectbox 61
Filter: radial search (de: Umkreissuche) 61
Area and interval: get parameters with date 63
Screen Shots¶
Frontend¶
Colored search words¶
Tree view and select boxes¶
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.
The Browser filter modul enables you to use hierarchical checkboxes.
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¶
Backend¶
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?¶
Search¶
Searching in displayed and in non displayed columns.
Searching for words and phrases. Example:
- Sword: "My Phrase" Word another word
- Will search for "My Phrase" or "Word" or "another" or "word".
Illustration 8: Tutorial in PDF format
The search is case insensitive.
The search is configurable:
- You can search in every column of every table. It doesn't matter, if table or field are displayed in the current view.
- You can configure the search form and the colours of the result items among others.
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
Tutorial search¶
Example with tt_news¶
Requirements¶
You need
- the extension Browser of course
- the extension tt_news
:sup:`0
<#sdfootnote1sym>`_ - a page with
- the plugin browser
- set in the tab [General] the type of the header to hidden
- set in the tab [Plugin] the startingpoint to your sysfolder with the news records
- an extension template
- with the include static template of the browser
- and in the setup field the TypoScript from below.
- the plugin browser
TypoScript¶
plugin.tx_browser_pi1 {
views {
list {
1 {
select = tt_news.title, tt_news_cat.title
}
}
single {
1 {
select = tt_news.title, tt_news.short, tt_news.bodytext, tt_news_cat.title
}
}
}
}
This is the TypoScript for
- a list view with the fields tt_news.title and tt_news_cat.title and
- a single view with the fields tt_news.title, tt_news.short, tt_news.bodytext, tt_news_cat.title.
Result in the Frontend¶
The Result in the frontend should look like the screen shot below, if you are using the German language:
Test it!¶
Familiarize you with the search.
Example with seven words¶
Search for seven words: Browser Erweiterung Bequem durch die Daten browsen
With words and phrases¶
Search for words and phrases: Browser Erweiterung "Bequem durch die Daten browsen"
Configuring the search form¶
Configuring with the Plugin¶
Plugin Tab [Lists]
Set the Search mode to [Configured]
Comment¶
- Search: TutorialsDummy check box for information only. link to the online tutorial
- Search: Form
- [X] Display the form
- [X] with result phraseResult phrase will appear below the form.
- [X] with colored swords (list view)Search words will be colored in the list view. But there is an exclusion: Search words linked values won't be colored.
- [ ] with colored swords (single view)Search words will be colored in the single view. But there are some exclusions: Search words in children records and linked values won't be colored.
- Search: Checkpoint for colored search words in the single viewDummy check box for information only.If you have the search word in the URL, you can get different links to the same content. Search engines doesn't like it!
- Search: wild-cards
- Self-acting (recommended)Search words will wrapped with wild-cards by default
- User have to add wild-cards
- Search: char for a wild-cardYou can use another wild-card. Be aware that are conflicts with the SQL queries: '%' isn't possible for example.
List without any Search Form¶
Search Form without any Result Phrase¶
Configuring the Result Phrase¶
If you want change the phrase of the result phrase, please configure
plugin.tx_browser_pi1.displayList.display.searchform.resultPhrase {
searchFor.value = Search for
searchFor.lang.de = Suche nach
...
}
Search results with other Colors¶
If you like to want less, more or other colors for the search result, please configure the array wrapSwordInResult.
Be aware that displayList and displaySingle have there own search form array.
// List View
plugin.tx_browser_pi1.displayList.display.searchform {
searchform {
wrapSwordInResults {
0 {
wrap = <span style="background:#ffff7f">|</span>
}
1 {
wrap = <span style="background:#b3ffb2">|</span>
}
...
}
}
}
// Single View
plugin.tx_browser_pi1.displaySingle.display.searchform {
searchform {
wrapSwordInResults {
0 {
wrap = <span style="background:#ffff7f">|</span>
}
1 {
wrap = <span style="background:#b3ffb2">|</span>
}
...
}
}
}
Extending the search¶
Usually visitors of a website can search in the displayed columns only.
The Browser enables to search in every table and field you like - independing of the display mode.
Example¶
You want to display in the list view only the fields: tt_news.title, tt_news_cat.title.
But the visitor should search in the fields: tt_news.title, tt_news.short, tt_news.bodytext.
TypoScript¶
plugin.tx_browser_pi1 {
views {
list {
1 {
select = tt_news.title, tt_news_cat.title
search = tt_news.title, tt_news.short, tt_news.bodytext
}
}
}
}
Search and filter¶
By default the search doesn't respect any filter. This has an effect only, if you are using filters or a category menu.
The effect is, that
Security¶
The Minimum Length of a Sword Word¶
The default for the minimum length of a sword word is three chars. If a word is shorter, it will be removed from the sword.
If you want to increase or decrease the minimum length, please configure minLenWord:
plugin.tx_browser_pi1.advanced {
security {
sword {
minLenWord = 3
}
}
}
MySQL Security: add Slashes¶
The Browser secures swords with the PHP method mysql_real_escape_string().
mysql_real_escape_string() adds slashes to x00, n, r, , ', " and x1a, but not to %.
The Browser adds a slash to % too. If you don't like it, please configure csvChars:
plugin.tx_browser_pi1.advanced {
security {
sword {
addSlashes {
csvChars = %
}
}
}
}
If you need slashes for more than the %, please add the chars to csvChars comma separated like in the code below:
plugin.tx_browser_pi1.advanced {
security {
sword {
addSlashes {
csvChars = %, `, ´
}
}
}
}
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>
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.
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¶
- 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.
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.
You job is now, to add models and to allocate manufacturers.
After finishing you should have a result like in the illustration below.
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.
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.
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.
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.
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).
TREEVIEW¶
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¶
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¶
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
}
}
}
}
}
}
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¶
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¶
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¶
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)¶
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.
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
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)
Change the Behaviour¶
Display price-brackets even if they haven't any hit¶
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¶
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¶
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:
- HTML http://typo3.org/documentation/document-library/extension- manuals/browser/current/
- PDF: http://typo3.org/extensions/repository/view/browser/current/info /?tx_terfe_pi1%5BdownloadFile%5D=doc%252Fmanual.pdf
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
RADIAL SEARCH¶
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¶
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: 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:
- http://hfs.die-netzmacher.de/kalender/month/201103/
- http://hfs.die-netzmacher.de/kalender/month/201104/
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¶
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.
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)
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