.. You may want to use the usual include line. Uncomment and adjust the path. .. include:: ../Includes.txt ============================ 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: |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, 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: Table of Contents ----------------- **`EXT: Generic list and detail 1 <#__RefHeading__5708_1738894311>`_** **`Introduction 3 <#__RefHeading__5710_1738894311>`_** `What does it do? 3 <#__RefHeading__463_413120346>`_ **`Users manual 4 <#__RefHeading__467_413120346>`_** **`Configuration 5 <#__RefHeading__31515_818911409>`_** `High level configuration 5 <#__RefHeading__814_1233885254>`_ `Table configuration 5 <#__RefHeading__816_1233885254>`_ `Query configuration 6 <#__RefHeading__818_1233885254>`_ `Fields configuration 6 <#__RefHeading__820_1233885254>`_ **`Template 8 <#__RefHeading__31525_818911409>`_** **`To-Do list 9 <#__RefHeading__477_413120346>`_** .. _Introduction: Introduction ------------ .. _What-does-it-do: 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: 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: Configuration ------------- .. _High-level-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. .. ### BEGIN~OF~TABLE ### .. _table: table """"" .. container:: table-row Property table Data type string Description Name of a table to be displayed Default .. _table-name: “table\_name” """"""""""""" .. container:: table-row Property “table\_name” Data type ->table configuration Description Name of a table (as defined in SQL) Default .. ###### END~OF~TABLE ###### .. _Table-configuration: Table configuration ^^^^^^^^^^^^^^^^^^^ .. ### BEGIN~OF~TABLE ### .. _titleObj-stdWrap: titleObj /+stdWrap """""""""""""""""" .. container:: table-row Property titleObj /+stdWrap Data type cObject Description Will be used in detail view to render title tag Default .. _titleField: titleField """""""""" .. container:: table-row Property titleField Data type string Description Field name that will be used in title tag (simplier version of the above option). Default .. _pidList: pidList """"""" .. container:: table-row Property pidList Data type list Description List of pids where records are stored Default Current page ID .. _recursive: recursive """"""""" .. container:: table-row Property recursive Data type int Description Level of recursion of the pidList Default .. _singleViewParameter: singleViewParameter """"""""""""""""""" .. container:: table-row 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: query """"" .. container:: table-row Property query Data type ->query Description Query definition Default .. _sort: sort """" .. container:: table-row 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: localization """""""""""" .. container:: table-row Property localization Data type boolean Description Defines whether your records are localized Default 0 .. _pager: pager """"" .. container:: table-row 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: singleViewInPid """"""""""""""" .. container:: table-row 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: listFields """""""""" .. container:: table-row Property listFields Data type ->fields Description Definition of fields in list view Default .. _singleFields: singleFields """""""""""" .. container:: table-row Property singleFields Data type ->fields Description Definition of fields in single view Default .. ###### END~OF~TABLE ###### .. _Query-configuration: Query configuration ^^^^^^^^^^^^^^^^^^^ .. ### BEGIN~OF~TABLE ### .. _results-at-a-time: results\_at\_a\_time """""""""""""""""""" .. container:: table-row Property results\_at\_a\_time Data type Int Description Number of records per page Default .. _maxPages: maxPages """""""" .. container:: table-row Property maxPages Data type Int Description Max number of pages to be shown in page browser at once Default .. _orderBy: orderBy """"""" .. container:: table-row Property orderBy Data type String Description Default order by when first shown Default .. ###### END~OF~TABLE ###### .. _Fields-configuration: 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: 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: Examples """""""" :: mainim = IMAGE mainim.file { import = uploads/tx_pxbshop/ import.field = mainim maxW = 201 maxH = 150 } price2 = TEXT price2 { field = price2 noTrimWrap = || Kč| 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 = || required = 1 } .. _Template: 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: 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 `_ . .. ######CUTTER_MARK_IMAGES###### .. |img-1| image:: img-1.png .. :align: left .. :border: 0 .. :height: 44 .. :id: graphics5 .. :name: graphics5 .. :vspace: 57 .. :width: 161 .. |img-2| image:: img-2.png .. :align: left