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: Generic list and detail

Author:Christopher
Created:2010-12-18T19:57:23
Changed:2011-09-02T20:13:58.990000000
Classification:jb_genericlistanddetail
Description:The keywords help with categorizing and tagging of the manuals. You can combine two or more keywords and add additional keywords yourself. Please use at least one keyword from both lists. If your manual is NOT in english, see next tab "language" ---- forEditors (use this for editors / german "Redakteure") forAdmins (use this for Administrators) forDevelopers (use this for Developers) forBeginners (manuals covering TYPO3 basics) forIntermediates (manuals going into more depth) forAdvanced (covering the most advanced TYPO3 topics) see more: http://wiki.typo3.org/doc_template#tags ----
Keywords:forDevelopers, forAdvanced
Author:Jan Bednarik
Email:info@bednarik.org
Language:en

img-1 img-2 EXT: Generic list and detail

Extension Key: jb_genericlistanddetail

Language: en

Version: x.y.z

Keywords: forDevelopers, forAdvanced

Copyright 2006-2011, Jan Bednarik, <info@bednarik.org>

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

`EXT: Generic list and detail 1 <#__RefHeading__5708_1738894311>`_

`Introduction 3 <#__RefHeading__5710_1738894311>`_

What does it do? 3

`Users manual 4 <#__RefHeading__467_413120346>`_

`Configuration 5 <#__RefHeading__31515_818911409>`_

High level configuration 5

Table configuration 5

Query configuration 6

Fields configuration 6

`Template 8 <#__RefHeading__31525_818911409>`_

`To-Do list 9 <#__RefHeading__477_413120346>`_

Introduction

What does it do?

How many times did you need simple listing with sorting, paging and detail view of a custom table? How many times did you copy the same code because of it? Well, now you don't need to.

This extension provides fully customizable, configurable and templateable list with paging and sorting and detail view.

All fields in your list/detail can be customized via stdWrap and you can even add new fields via TS configuration.

Users manual

After installing this extension you'll need to provide configuration for the table you are about to display.

There's a sample configuration to show simple list/detail of tt_news table. You can refer to that.

You don't need to include static template, it only contains sample configuration.

Configuration

High level configuration

There's only 1 high level configuration option called “table”. It's here so you can add this plugin into page via TS instead of adding it as content element. But you can pass the table name using FlexForm when you add this plugin into page.

This means you can use this extension to display multiple tables within one website.

table

Property

table

Data type

string

Description

Name of a table to be displayed

Default

“table_name”

Property

“table_name”

Data type

->table configuration

Description

Name of a table (as defined in SQL)

Default

Table configuration

titleObj /+stdWrap

Property

titleObj /+stdWrap

Data type

cObject

Description

Will be used in detail view to render title tag

Default

titleField

Property

titleField

Data type

string

Description

Field name that will be used in title tag (simplier version of the above option).

Default

pidList

Property

pidList

Data type

list

Description

List of pids where records are stored

Default

Current page ID

recursive

Property

recursive

Data type

int

Description

Level of recursion of the pidList

Default

singleViewParameter

Property

singleViewParameter

Data type

string

Description

Name of URL parameter for single view. This way each table can have different parameter and so different CoolUri/RealUrl mapping

Default

query

Property

query

Data type

->query

Description

Query definition

Default

sort

Property

sort

Data type

Description

List of field names and titles for sorting

sort {
title = Title
price = Price
}

Will show 2 sorting options for Title and Price

Default

localization

Property

localization

Data type

boolean

Description

Defines whether your records are localized

Default

0

pager

Property

pager

Data type

Description

Configuration of pagebrowser. You should use ref to plugin.tx_pagebrowse_pi1

pager < plugin.tx_pagebrowse_pi1
pager {
      templateFile = fileadmin ...
}

Default

singleViewInPid

Property

singleViewInPid

Data type

boolean

Description

When true, records PID will be used as single view page, otherwise, current page will be used

Default

listFields

Property

listFields

Data type

->fields

Description

Definition of fields in list view

Default

singleFields

Property

singleFields

Data type

->fields

Description

Definition of fields in single view

Default

Query configuration

results_at_a_time

Property

results_at_a_time

Data type

Int

Description

Number of records per page

Default

maxPages

Property

maxPages

Data type

Int

Description

Max number of pages to be shown in page browser at once

Default

orderBy

Property

orderBy

Data type

String

Description

Default order by when first shown

Default

Fields configuration

Fields configuration is just list of fields with stdWrap. They are reffered to in template as ###FIELD_fieldName###.

When field is not specified here, marker will be replaced with plain value.

Even field that's not in a table can be defined here, it will be rendered. However, in it's configuration you have to, of course, refer to existing field.

priceNoVat = TEXT
 priceNoVat {
 field = price
 stdWrap.wrap = |/1.2
 prioriCalc = 1
 }
Specials

In order to easily display RTE contents, special type “RTE” is recognized.

# This content will be rendered as HTML from RTE area
fieldName = RTE

To show field that contains comma seprated list (e.g. list of images), a property “listSeparator” is recognized. It will then render each item as the defined field, where “listValue” will be actual value.

# This will be rendered as list of images
imgs {
 listSeparator = ,
 file.maxH = 100
 file.maxW = 200
 file.import = uploads/tx_pxbshop/
 file.import.field = listValue
}

Both specials can be done via regular TS, but it's not that straightforward.

Examples
mainim = IMAGE
mainim.file {
    import = uploads/tx_pxbshop/
    import.field = mainim
    maxW = 201
    maxH = 150
}
price2 = TEXT
price2 {
    field = price2
    noTrimWrap = |<del class="cena">| </del>|
    required = 1
    preUserFunc = user_PxbShopFunctions->user_moneyFormat
}
basket = TEXT
basket {
    value = foo
    typolink.parameter.data = page : uid
    typolink.returnLast = url
}
special = TEXT
special {
    field = special
    noTrimWrap = |<span class="special |"></span>|
    required = 1
}

Template

Refer to example template in pi1/listanddetailTemplate.html

Sorting – in order to make template simple, ascending and descending links have by default classes “asc” and “desc”, currently selected sort and direction has another class “act”.

To-Do list

Single view pid – now it's possible to show single view on current page or item's parent page

Feel free to send me any ideas on info@bednarik.org .