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.

EXT: th_genericlist

Author:Kasper Skårhøj
Created:2002-11-01T00:32:00
Changed:2008-04-03T12:47:47
Author:Dev-Team Typoheads
Email:dev@typoheads.at
Info 3:
Info 4:

EXT: th_genericlist

Extension Key: th_genericlist

Copyright 2000-2002, Dev-Team Typoheads, <dev@typoheads.at>

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.com

Table of Contents

EXT: th_genericlist 1

Introduction 1

What does it do? 1

Screenshots 2

Users manual 6

Configuration 6

This is how it works (Overview) 6

TS Reference – Basic (plugin.tx_thgenericlist_pi1) 6

TS Reference – View (plugin.tx_thgenericlist_pi1.tables.[View]) 6

TS Reference – Table (plugin.tx_thgenericlist_pi1.tables.[View].[DB- Table]) 6

TS Reference – File Mode (plugin.tx_thgenericlist_pi1.tables.[View ].[db-table].fileMode) 9

File Mode prefilled values/markers 11

API-functions 12

HTML-Templates 15

Predefined markers 15

Known problems 16

To-Do list 16

Changelog 16

Introduction

What does it do?

  • generate various list views based on db-records or files (based on HTML-templates)
  • TS-rendering for each DB-table field-value or manual defined markers
  • limit of records per page
  • page-browser with next/back links to browse trough records
  • multiple “views” can be defined per database-table – user can select table and view that should be displayed in plugin-record as well as a starting point where the records are taken from
  • limit records to a specific time range e.g. only show records of the last 4 days

Schematic Overview:

img-1

Screenshots

Frontend :

Listing of a “filings” database table:

img-2

Example of a simple shop with filter and sorting mechanism:

img-3

Example for an image-gallery based directories and DAM records. List- view:

img-4

Image-gallery: Detail-view and List-view:

img-5

Image-gallery: Detail-view and List-view. Function “recalculate offset” activated.

img-6

Backend (plugin) :

img-7

Users manual

Configure the “tables” and “view” settings in TS first. Then you can choose them in the plugin-record.

Configuration

  • depends on “api_macmade” extension
  • all Configuration of tables and views are defined in TS (see next sections)

This is how it works (Overview)

Define your view and DB-table like this:

plugin.tx_thgenericlist_pi1.tables.[your view].[your DB-table] {
        # all further configuration (select,sorting, markers,...) comes here
        # configuration for markers
        fieldConf {...} # field config for each database table field
        recordMarkers {...} # individual markers per record row
        markers { ... } # global markers that can be used in the HTML-template
}

TS Reference – Basic (plugin.tx_thgenericlist_pi1)

debug

Property

debug

Data type

boolean

Description

Set to “1” to get the SQL query-string that is executed displayed.

Default: 0

tables.[view]

Property

tables.[view]

Data type

[configuration]

Description

See “TS Reference - View”.

plugin.tx_thgenericlist_pi1

TS Reference – View (plugin.tx_thgenericlist_pi1.tables.[View])

beName

Property

beName

Data type

string

Description

This name is shown in the plugin-module. Insert name of this view here.

example:

tables.detailview.beName = Detail View
tables.detailview.beName = LLL:[somepath]/locallang_db.xml:detail_view
[database table name]

Property

[database table name]

Data type

[configuration]

Description

See “TS Reference - Table”.

plugin.tx_thgenericlist_pi1.tables.[view].

TS Reference – Table (plugin.tx_thgenericlist_pi1.tables.[View].[DB-Table])

beName

Property

beName

Data type

string

Description

This name is shown in the plugin-module. Insert name of this view here.

example:

tables.detailview.beName = tt-content

tables.detailview.beName = LLL:[somepath]/locallang_db.xml:tt_content

recordfolder

Property

recordfolder

Data type

int

Description

Page-ID where the records should be selected from.

This setting is overwritten by plugin-setting “start page”.

multilang

Property

multilang

Data type

boolean

Description

If set to “1”: adds where-clause to select syntax: sys_language_uid= ..

template_file

Property

template_file

Data type

string

Description

Path to HTML-template file taken for this view/table.

example:

[mytable].template_file = fileadmin/templates/ext/th_genericlist/tt_content.html
defaultSorting

Property

defaultSorting

Data type

string

Description

DB-field taken for sorting.

example:

[mytable].defaultSorting = date desc
recordsPerRow

Property

recordsPerRow

Data type

INT

Description

Number of database records that are shown in one row (next to each other in one row).

The subpart ###ELEMENT### is repeated by the number of times configured in recordsPerRow.

limit

Property

limit

Data type

[configuration]

Description

optional

example:

only show records not older than 2 days and 6 hours:

limit.ageDays = 2

limit.ageHours = 6

limit.dbField = tstamp

limit.maxRecords

Property

limit.maxRecords

Data type

int

Description

Limit records per page to this number.

default: 10

limit.ageDays

Property

limit.ageDays

Data type

int

Description

Only show records with maximum age of X days.

ATTENTION: “limit.dbField” must be set and of type “timestamp”.

limit.ageHours

Property

limit.ageHours

Data type

int

Description

Only show records with maximum age of X hours.

ATTENTION: “limit.dbField” must be set and of type “timestamp”.

limit.dbField

Property

limit.dbField

Data type

string

Description

DB-fieldname – must be of type “timestamp” if “ageDays” or “ageHours” is used.

limit.timeRangeStart

Property

limit.timeRangeStart

Data type

TS

Description

Limit result to a specific time range starting from this timestamp.

Only takes effect if value > 0.

example:

limit.timeRangeStart = TEXT
limit.timeRangeStart.data = GPvar:timeRangeStart
limit.timeRangeSize

Property

limit.timeRangeSize

limit.timeRangeSize.year

limit.timeRangeSize.month

limit.timeRangeSize.day

Data type

int

Description

Defines the time range (only if “timeRangeStart” is set and > 0).

example: only show records of a specific month:

limit.timeRangeSize.month = 1

only works if timeRangeStart is submitted via GET/POST with a timestamp value:

limit.timeRangeStart = TEXT
limit.timeRangeStart.data = GPvar:timeRangeStart
selectFields

Property

selectFields

Data type

string

Description

optional

Select only these DB fields instead of * for better performance.

ATTENTION: make sure, all fields defined in .fieldConf are listed here!

Info: The primaryKey is added to the selectFields automatically.

default: *

example:

[mytable].selectFields = uid,pid,header,bodytext,tstamp
primaryKey

Property

primaryKey

Data type

string

Description

optional

Primary Key of db-table. Will be sent along with every link (next/back). If your primary key consists of two database fields simply write them separated by “,”.

Info: the primaryKey is automatically added to the “selectFields”.

default: uid

additionalWhere.[int]

Property

additionalWhere.[int]

additionalWhere.1

additionalWhere.2

Data type

string

Description

optional

Additional Where clause for select.

example:

[mytable].additionalWhere.1.value = starttime < now()
[mytable].additionalWhere.2.value = (endtime > now() OR endtime = 0)
fieldConf

Property

fieldConf

Data type

[DB-fieldname] = TS

Description

optional

Field config for each database table field.

ATTENTION: used fields must be selected by “selectFields” (see above).

example:

fieldConf.title = TEXT
fieldConf.title.field = title
fieldConf.title.typolink {
   target = _blank
   parameter.dataWrap = uploads/tx_thpressreleases/{field:file}
}

fieldConf.date = TEXT
fieldConf.date.field = tstamp
fieldConf.date.strftime = %d.%b.%Y
recordMarkers

Property

recordMarkers

Data type

[markername] = TS

Description

optional

Markers replaced in every record row.

See “fieldConf” settings.

markers

Property

markers

Data type

[markername] = TS

Description

optional

Markers to be used in HTML template.

See “fieldConf” settings.

detail

Property

detail

Data type

Description

optional

Detail-View configuration (only one record should be displayed).

detail.Parameter

Property

detail.Parameter

Data type

string

Description

Name of GET/POST variablename.

example:

...&tx_a21glossary[uid]=12

detail.Parameter = tx_a21glossary|uid
detail.additionalWhere

Property

detail.additionalWhere

Data type

string

Description

Added to select statement for detail view.

markers: ###Parameter###

example:

detail.additionalWhere = uid=###Parameter###
recalculateOffset

Property

recalculateOffset

Data type

Boolean

Description

Enable/Disable recalculation of offset value (pagebrowser).

Only necessary if you have a detail view of a record configured where “next” and “back” navigation to the next/previous record is possible and a list-view is shown below the detail view. The list view will always show the correct list of the selected detail-record.

See example screenshot of an image gallery in the “screenshot” chapter.

recalculateOffset.GPvar

Property

recalculateOffset.GPvar

Data type

String

Description

Name of GET/POST variable containing the unique ID of the record to be shown (e.g. in detail view).

example: picid

recalculateOffset.startWith

Property

recalculateOffset.startWith

Data type

INT (0/1)

Description

Usually the first value in an array is in [0]. Sometimes you don't want to start the pagebrowser with “0” but with “1” instead. Example : 1 2 [3] 4 .. 10 . If this is the case, you can correct the wrong parameter value (which is 1 instead of 0 for the first page) by setting recalculateOffset.startWith = 0;

set it to 0 ... if you start with numbering 0.

set it to 1 .. if you start with numbering 1.

pagebrowser

Property

pagebrowser

Data type

see config below

Description

pagebrowser.numShowLeftRight

Property

pagebrowser.numShowLeftRight

Data type

INT

Description

Number of pages to be shown left/right of current page.

example:

pagebrowser.numShowLeftRight = 2

output: 1 2 [3] 4 5

pagebrowser.numShowLeftRight = 3

output: 1 2 3 [4] 5 6 7

pageBrowser.startWith

Property

pageBrowser.startWith

Data type

INT (0/1)

Description

Start numbering with 0 or 1? Only for FE-output – the offset parameter will still start with “0” if startWith is set to 1.

example:

pageBrowser.startWith = 1

output: 1 2 [3] 4 5

pageBrowser.startWith = 1

output: 0 1 [2] 3 4

pageBrowser.showFirstLast

Property

pageBrowser.showFirstLast

Data type

Boolean

Description

Show "first" and "last" page-link within pagination.

example:

pageBrowser.showFirstLast = 1

output: 1 ... 4 [5] 6 ... 10

pageBrowser.showFirstLast = 0

output: ... 4 [5] 6 ...

pageBrowser.firstLastSeparator

Property

pageBrowser.firstLastSeparator

Data type

String

Description

Separator between first and last page.

Only used if showFirstLast = 1

example:

pageBrowser.firstLastSeparator = ...
pageBrowser.separator

Property

pageBrowser.separator

Data type

String

Description

Separator between pages.

example:

pageBrowser.separator = &nbsp;-&nbsp;
pageBrowser.pageWrap

Property

pageBrowser.pageWrap

Data type

wrap

Description

Wrap around not selected pages.

example:

pageBrowser.pageWrap = <b>|</b>
pageBrowser.pageWrapSelected

Property

pageBrowser.pageWrapSelected

Data type

wrap

Description

Wrap around selected/current page.

example:

pageBrowser.pageWrapSelected = <b><i>[|]</b></i>
checkAccessRights

Property

checkAccessRights

Data type

Boolean

Description

0 ... add SQL-perms-clause to check FE-access rights (based on fe_groups level).

Info: if the fe_groups are not stored in the DB-field “fe_group”, you can configure the other fieldname (see below).

checkAccessRights.dbFieldName

Property

checkAccessRights.dbFieldName

Data type

String

Description

Only necessary if checkAccessRights =1 and the FE-groups are stored in a different field than “fe_group”.

fileMode

Property

fileMode

Data type

file/db/mixed

Description

Activate this setting if you want to display a list of files from a directory or a combination between DB-records and files (like DAM or KB-YAG).

fileMode.

Property

fileMode.

Data type

[configuration]

Description

See “TS Reference – File Mode”.

sumFields

Property

sumFields

Data type

String

Description

Calculate the sums of the given fields.

Attention:

  • file mode (db/mixed/file) NOT activated (=DB-mode): sum is done via SQL query in DBso make sure the given field names exist in the DB!markers:###sum_[fieldname]### ... sum calculated via DB query
  • file mode (db/mixed/file) ACTIVATED (=file-mode): sum is done via PHP loop of all affected records (see table “File Mode prefilled values/markers” below for available attriutes you might sum)markers:- ###total_sum_[fieldname]### ... sum calculated of ALL affected records/files (not only the one shown on the current page)- ###page_sum_[fieldname]### ... sum calculated of records/files shown on current page (if pagination is used)

formating a calculated sum:

markers.sum_[fieldname] = TEXT
markers.sum_[fieldname].field = [fieldname]

or

markers.total_sum_[fieldname] = TEXT
markers.total_sum_[fieldname].field = [fieldname]

or

markers.page_sum_[fieldname] = TEXT
markers.page_sum_[fieldname].field = [fieldname]

Info:

With the help of this setting, you can display the total size of all shown files listed.

((Unknown Property))

Property

Data type

Description

plugin.tx_thgenericlist_pi1.tables.[view].[database table name].

TS Reference – File Mode (plugin.tx_thgenericlist_pi1.tables.[View].[db-table].fileMode)

If you want to display a browsable tree of directories, you can use the built-in function. Define a marker for the tree like this:

markers {
   treemenu = USER_INT
   treemenu.userFunc = tx_thgenericlist_api->user_getTreeMenu
   treemenu {
     directory < plugin.tx_thgenericlist_pi1.tables.listView.tx_dam.fileMode.directory
     GPvarName = directory
     selected.wrap = <b>|</b>
  }
}

The marker ###treemenu### will output a browsable tree. By clicking on a directory, the page gets reloaded plus a GET parameter (defined by “GPvarName”) is sent along with a relative path of the selected directory (relative to the base-directory configured in the plugin).

directory

Property

directory

Data type

String

Description

Directory the files get selected from. This setting is overwritten by the directory selected in the plugin-element.

path is extended by GP:directory:

[directory][GP:directory]

all "../" are cut of from GP:directory which makes sure, that only deeper dirs are available to the user - “../../typo3conf/” won't work.

example:

directory = fileadmin/beispielbilder/
recursive

Property

recursive

Data type

TS-TEXT object

Description

1 ... read and list files recursive from given directory.

0 ... read and list files only from the given directory.

example:

recursive = TEXT
recursive.value = 1
allowedFileTypes

Property

allowedFileTypes

Data type

TS-TEXT object

Description

Limit the read/listed files by filetype(s).

example:

allowedFileTypes = TEXT
allowedFileTypes.value = jpg,gif,png
defaultValue.[fieldname]

Property

defaultValue.[fieldname]

Data type

TS-TEXT object

Description

Default-values for file-record. Find a list of possible default- settings in the table below (“File Mode prefilled values/markers”).

Info: The fields can be used for sorting.

example:

List is sorted by "title" which comes from the correlating DB-record (DAM,KB_YAG,..).

If no db-record is found (or the "title" field is empty) the "title" field is filled with the filename.

defaultValue.title = TEXT
defaultValue.title.field = filename
displaySingle

Property

displaySingle

Data type

TS-TEXT object

Description

If you define a single-view for one file, you have to tell the system which file should be shown. This is done by adding the unique-ID of the file to the “detail”-link. In case you are using the fileMode = file setting, you have to use the “arrayID” for this. This unique-ID can be used and accessed as normal marker: ###arrayID### in your HTML- template or in TS via {field:arrayID} when building the detail-link.

See section “FileMode prefilled values/markers” for further information.

example (unique-ID is given in variable “picid”):

displaySingle = TEXT
displaySingle.value = {GPvar:picid}
displaySingle.insertData = 1
file2db

Property

file2db

Data type

[configuration]

Description

Mapping-mechanism between files and records. Only needed in mode “db” or “mixed”.

Makes it possible to find the correlating DB-record (e.g. DAM) to the selected files.

file2db.dbField

Property

file2db.dbField

Data type

String

Description

Database key(s) fieldnames. If the DB-key consists of two DB-fields, simply type them in separated by “,”.

example DAM:

file2db.dbField = file_name,file_path

example KB_YAG:

file2db.dbField = md5hash
file2db.key.[db-key]

Property

file2db.key.[db-key]

Data type

TS-USER object

Description

For each of the defined DB-keys (defined in “file2db.dbField”) you need to specify a user-function that is called to calculate the key.

For DAM or KB_YAG the user functions come along with th_genericlist.

example DAM:

file2db.key.file_name = USER
file2db.key.file_name.userFunc = user_genericlistFile2DBFunctions->user_DAMFileName
file2db.key.file_path = USER
file2db.key.file_path.userFunc = user_genericlistFile2DBFunctions->user_DAMFilePath

example KB_YAG:

file2db.key.md5hash = USER
file2db.key.md5hash.userFunc = user_genericlistFile2DBFunctions->user_kbyagFile
fileFilter.[INT].

Property

fileFilter.[INT].

Data type

Description

Allows you to define one or more filter(s). A filter is like a SQL- Where clause. Only files/records that pass all filter-checks will be shown.

Info: The comparison method is implemented in PHP.

example for two filters:

fileFilter.10.
fileFilter.20.
fileFilter.[INT].check

Property

fileFilter.[INT].check

Data type

method for comparison

Description

The following methods are implemented:

  • =
  • !=
  • <
  • >
  • like (PHP stristri method used)
  • ereg
  • eregi

example:

fileFilter.10.check = =
fileFilter.20.check = like
fileFilter.[INT].field

Property

fileFilter.[INT].field

Data type

String

Description

Record-field that will be used for comparison. See table “File Mode prefilled values/markers” table below for a list of predefined fields that can be used for file-filtering.

You could also use a field of the correlating database-record e.g. “tx_dam” record if you have configured the fileMode to “db”.

example:

fileFilter.10.field = size
fileFilter.20.field = filename
fileFilter.[INT].compareValue

Property

fileFilter.[INT].compareValue

Data type

TS-TEXT-object

Description

Value of “.field” is compared with the value of the given TS-TEXT- object.

example:

see complete examples below.

fileFilter.10.compareValue = TEXT

fileFilter.10.compareValue.value = 67000

fileFilter.20.compareValue = TEXT

fileFilter.20.compareValue.value = jeff

((Unknown Property))

Property

Data type

Description

complete examples for fileFilter:

fileFilter {
  10.check = =
  10.field = filename
  10.compareValue = TEXT
  10.compareValue.value = JEFF1733.jpg

  20.check = <
  20.field = size
  20.compareValue = TEXT
  20.compareValue.value = 67456

  30.check = >
  30.field = size
  30.compareValue = TEXT
  30.compareValue.value = 65456

  40.check = like
  40.field = filename
  40.compareValue = TEXT
  40.compareValue.value = JEFF

  50.check = ereg
  50.field = filename
  50.compareValue = TEXT
  50.compareValue.value = JEFF.?

  60.check = eregi
  60.field = filename
  60.compareValue = TEXT
  60.compareValue.value = JEFf.?
}

plugin.tx_thgenericlist_pi1.tables.[view].[database table name].fileMode.

File Mode prefilled values/markers

If you want to display files (either in mode “file” or “mixed”) the following default values are gathered from the file and added to the internal array-record-values (can be accessed like a DB-field value of e.g. tt_news record).

The function “getTotalFileInfo” is used for getting basic file informations. Some special values are added by genericlist to make further processing easy.

You can simply access these variables within the ###ELEMENT### subpart via ###[key]###.

example:

<!-- ###ELEMENT### begin -->
filename: ###filename###
Size: ###size###
<!-- ###ELEMENT### end -->
path

Key

path

Value

Path to the file (with “/” at the end).

example:

fileadmin/beispielbilder/Menschen/

file

Key

file

Value

Original filename.

example:

hans_meiser.jpg

filebody

Key

filebody

Value

Filename without file-extension.

example:

hans_meiser

fileext

Key

fileext

Value

File-extension.

example:

jpg

realFileext

Key

realFileext

Value

see “fileext”

tstamp

Key

tstamp

Value

Timestamp of the file.

example:

1196077980

size

Key

size

Value

Size of the file in bytes.

example:

90607

type

Key

type

Value

If current file is a file or a directory.

example:

file

owner

Key

owner

Value

Owner of the file on system-level.

example:33

perms

Key

perms

Value

File permissions on system-level.

example:

33279

writable

Key

writable

Value

readable

Key

readable

Value

filename

Key

filename

Value

see “file”

filepath

Key

filepath

Value

Like “path” but without “/” at the end.

example:

fileadmin/beispielbilder/Menschen

filenameWithPath

Key

filenameWithPath

Value

Filename with path. Blanks are replaced by %20.

example:

fileadmin/beispielbilder/Menschen/hans_meiser.jpg

filepathRelative

Key

filepathRelative

Value

see “filepath”. Blanks are replaced by %20.

arrayID

Key

arrayID

Value

This variable holds the ID of the current record/file. All files affected will be added to an internal array. So each file has a unique ID which is the array-key. You can use this parameter for detail links or “next” and “back” links in a detail-view: simply add/subtract 1 to the ID of the current shown file/record.

totalCount

Key

totalCount

Value

This holds the number of total files/records affected in the current view. Useful if you want need to add a variable to your detail-link which holds the maximum number of files/records affected.

API-functions

Sometimes you need special functions when you are working with lists and detail-views. Some helpful functions are already implemented in the “tx_thgenericlist_api” class which is automatically loaded with the extension. So wherever you use the “th_genericlist” plugin, you can also call the API-functions as USER or USER_INT TypoScript objects.

example for calling an API-function:

markers.nextUID = USER
markers.nextUID.userFunc = tx_thgenericlist_api->user_getNextID
markers.nextUID {
        [config parameters for the API-function come here]
}
user_getTreeMenu

API function

user_getTreeMenu

Description/Configuration

Only useful in fileMode.

Function returns complete HTML-code of a tree of subdirectories of the given/defined path.

Parameters:

  • directory: Path to a directory. All subdirectories will be displayed as clickable tree.
  • GPvarName: When you click on a directory of the displayed tree, the page gets called again plus a parameter gets added which holds the path of the clicked directory. With this setting you can configure the variablename.
  • selected.wrap: The selected directory will be wrapped with this wrap.
  • keepVarsInLinks: If you want to keep some GET/POST vars when clicking on a directory within the tree, you can specify them here.

example:

treemenu = USER_INT
treemenu.userFunc = tx_thgenericlist_api->user_getTreeMenu
treemenu {
  directory fileadmin/beispielbilder/
  GPvarName = directory
  selected.wrap = <b>|</b>
  # path to JS for tree generation (with / at the end) (optional)
  # pathToJS = fileadmin/templates/js/
  #
  # path to tree-menu images (optional)
  # imageDir = fileadmin/templates/treemenu/images
  #
  # parameters added to tree-links (optional)
  keepVarsInLinks.1 = picid
  keepVarsInLinks.2 = offset
}
user_getNextID

API function

user_getNextID

Description/Configuration

Used in detailView for next link (file mode).

Returns ID of next file (arrayID+1).

Parameters:

  • GPvarNameCur: Name of Get/Post variable with detail-ID.
  • GPvarNameMax: Name of Get/Post variable with maximum number of files/records.
  • loop: 0/1 ... starts with 0 if next detail-ID > maxDetail-ID
  • startWith: 0/1 ... if loop=1 and next-ID > max-ID returns 0 or 1

example:

Make sure you send the “totalCount” value as parameter with the link to the detailview of the file/record (use ###totalCount### marker in HTML-template or {field:totalCount} in TS). In this example below. the GET/POST parameter for the detail-UID of the file/record is called “picid”.

markers {
  next = TEXT
  next.value = next
  next.typolink {
    useCacheHash = 1
    parameter.data = TSFE:id
    additionalParams.cObject = COA
    additionalParams.cObject {
      1 = TEXT
      1.value = &picid=
      2 = USER
      2.userFunc = tx_thgenericlist_api->user_getNextID
      2 {
        GPvarNameCur = picid
        GPvarNameMax = totalCount
        loop = 0
        startWith = 0
      }
      3 = TEXT
      3.value = &directory={GPvar:directory}&totalCount={GPvar:totalCount}
      3.insertData = 1
    }
  }
  next.if {
    value = 0
    isLessThan.cObject < plugin.tx_thgenericlist_pi1.tables.detailView.tx_dam.markers.next.typolink.additionalParams.cObject.2
    negate = 1
  }
}
user_getPrevID

API function

user_getPrevID

Description/Configuration

see “user_getNextID”

user_getGenericlistOffsetGP

API function

user_getGenericlistOffsetGP

Description/Configuration

This extension automatically adds some specific variables to some links. When using the “pageBrowser”, a variable called “tx_thgenericlist[ID of plugin-element][offset]” will be sent along with all links. This makes it possible to show several genericlist plugins on one page without variable collision.

if you don't want to loose the offset when you link to a detail view of a record, you have to add all “tx_thgenericlist[..]” values to the link. To help you adding these plugin-parameters to your links simply add this user-func to your link as additionalParams like in the example below:

example:

This shows how a link to a detail-view of a record is defined as recordMarker.

recordMarkers.filename = IMAGE
recordMarkers.filename {
   file.import.field = filenameWithPath
   file.import.listNum = 0
   file.width = 200
   imageLinkWrap = 1
   imageLinkWrap {
        enable = 1
        typolink {
                useCacheHash = 1
                parameter.data = TSFE:id
                additionalParams.cObject = COA
                additionalParams.cObject {
                        1 = TEXT
                        1.value = &picid={field:arrayID}&directory={GPvar:directory}&totalCount={field:totalCount}
                        1.insertData = 1
                        2 = USER
                        2.userFunc = tx_thgenericlist_api->user_getGenericlistOffsetGP
                }
        }
   }
}
((Unknown Property))

API function

Description/Configuration

HTML-Templates

List output is based on a HTML-template you have to create first and configure in TS.

There are two main subtemplates within the template file:

NO_RECORDS_FOUND

Subtemplate

NO_RECORDS_FOUND

Subtemplates within Subtemplate

Description

This template is shown if no records were found.

LISTVIEW

Subtemplate

LISTVIEW

Subtemplates within Subtemplate

Subtemplates:

LISTVIEW_ROW

LISTVIEW_EVENROW

LISTVIEW_ODDROW

BACK_LINK

NEXT_LINK

FIRST_LINK

LAST_LINK

Description

This template is shown if at least one record was found.

Markers defined in

plugin.tx_thgenericlist_pi1.tables.[view].[database table name].markers.

can be used in LISTVIEW subtemplate.

LISTVIEW_ROW

Subtemplate

LISTVIEW_ROW

Subtemplates within Subtemplate

ELEMENT

Description

This subtemplate has to be defined around the ELEMENT subtemplate. If you want alternating layouts for even/oddrows, define the subtemplates LISTVIEW_EVENROW and LISTVIEW_ODDROW instead.

LISTVIEW_EVENROW

Subtemplate

LISTVIEW_EVENROW

Subtemplates within Subtemplate

ELEMENT

Description

Used in combination with LISTVIEW_ODDROW subtemplate to create even/oddrows in your list-output.

LISTVIEW_ODDROW

Subtemplate

LISTVIEW_ODDROW

Subtemplates within Subtemplate

ELEMENT

Description

Used in combination with LISTVIEW_EVENROW subtemplate to create even/oddrows in your list-output.

ELEMENT

Subtemplate

ELEMENT

Subtemplates within Subtemplate

Description

This is the subtemplate for one DB-record (or for one file if you use fileMode).

This subpart gets repeated x times (as defined in plugin.tx_thgenericlist_pi1.tables.[view].[database table name].recordsPerRow)

This makes it possible to show two, three or more records next to each other in one row. Useful for image-galleries!

Predefined markers

###totalCount###

Marker

###totalCount###

Description

Number of all found records.

###pageBrowser###

Marker

###pageBrowser###

Description

Pagebrowser if configured in TS:

plugin.tx_thgenericlist_pi1.tables.[view].[database table name].pageBrowser

((generated))
Example

Primitive example for showing a list of tt_content records from a page:

plugin.tx_thgenericlist_pi1 {
  tables.normalView {
    beName = normal View

    #######################
    # DB-table
    #######################
    tt_content {
      beName = TT-content
      template_file = fileadmin/templates/ext/th_genericlist/tt_content.html
      fieldConf {

         date = TEXT
         date.field = tstamp
         date.strftime = %d.%b.%Y
      }
    }
  }
}

Advanced examples can be found in /th_genericlist/examples/ .

The advanced examples are not ment to be working on your installation because they are based on various plugins that are not published yet – but have a look what is possible and how the TS-syntax works.

In the near future a “th_genericlist_example” extension will be released with working examples.

Known problems

When using the fileMode and displaying the internal directory-tree, the loadingtime can be quite long if many subdirectories exist.

To-Do list

  • foreign-DB support: to get the list of records directly from other databases (Oracle,...)
  • Session-support: to generate the list of records from an array stored in FE-User-Session (useful for shops)
  • examples-extension “th_genericlist_example” with various examples should be created

Changelog

  • 0.1: initial release
  • 1.0: fileMode-support (allows file-listings with built-in directory picker (tree)), check access rights for db-records,...

img-8 EXT: th_genericlist - 16