.. You may want to use the usual include line. Uncomment and adjust the path. .. include:: ../Includes.txt ============================= tt\_news select configuration ============================= :Created: 2010-10-13T21:40:33 :Changed by: dirk :Changed: 2015-09-01T16:05:41 :Classification: ttnews_selectconf :Description: Add an andWhere clause to the SQL query of a tt_news. I.e. it is possible to display tt_news items in dependence on the fe_user ownership. :Keywords: tt_news, SQL, select, query, where :Author: Dirk Wildt - Die Netzmacher :Email: http://wildt.at.die-netzmacher.de :Website: http://die-netzmacher.de :Language: en |img-1| |img-2| tt\_news select configurationttnews\_selectconf |img-3| .. _tt-news-select-configuration: tt\_news select configuration ============================= Add an andWhere clause to the SQL query of a tt\_news. I.e. it is possible to display tt\_news items in dependence on the fe\_user ownership. |img-4| Version: 3.7.0 - 2015-09-01 Extension Key: ttnews\_selectconf Language: en Keywords: tt\_news, SQL, select, query, where Copyright 2009-2015, Dirk Wildt - Die Netzmacher, 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 ----------------- `tt\_news select configuration 1 <#__RefHeading__1165_1172745218>`_ `Screenshot 3 <#__RefHeading__1120_197809548>`_ `Introduction 4 <#__RefHeading__26967_649694667>`_ `What does it do? 4 <#__RefHeading__1648_2140038300>`_ `What do you need? 4 <#__RefHeading__1650_2140038300>`_ `Installation 5 <#__RefHeading__1654_2140038300>`_ `Extension Manager 5 <#__RefHeading__1656_2140038300>`_ `Samples 6 <#__RefHeading__1658_2140038300>`_ `Display news of the current day only 6 <#__RefHeading__1038_197809548>`_ `Display latest news only configured for selected plugins 6 <#__RefHeading__1040_197809548>`_ `Debug Query 7 <#__RefHeading__1042_197809548>`_ `Reference 8 <#__RefHeading__1662_2140038300>`_ `select 9 <#__RefHeading__1664_2140038300>`_ `Helpful suggestions and bug reports 10 <#__RefHeading__1666_2140038300>`_ `New Features and Bug Reports 10 <#__RefHeading__953_403784532>`_ `Further Information 11 <#__RefHeading__26969_649694667>`_ `Other extensions published by Die Netzmacher 11 <#__RefHeading__7815_621543893>`_ `Credits 12 <#__RefHeading__1668_2140038300>`_ `Change log 13 <#__RefHeading__28618_469190053>`_ `Illustration Index 14 <#__RefHeading__780_637468415>`_ `Alphabetical Index 15 <#__RefHeading__20259_1651812849>`_ .. _Screenshot: Screenshot ---------- |img-5| .. _Introduction: Introduction ------------ .. _What-does-it-do: What does it do? ^^^^^^^^^^^^^^^^ - The extension tt\_news select configuration enables you to add an andWhere clause to the SQL query of a tt\_news. I.e. it is possible to display tt\_news items in dependence on the fe\_user ownership. - The andWhere clause has the stdWrap property. - It's possible to configure tt\_news select configuration differently per each tt\_news plugin. .. _What-do-you-need: What do you need? ^^^^^^^^^^^^^^^^^ The extension tt\_news. .. _Installation: Installation ------------ .. _Extension-Manager: Extension Manager ^^^^^^^^^^^^^^^^^ - Open the extension manager, download the extension named tt\_news select configuration (extkey: ttnews\_selectconf) and install it. - Extend the typoscript of your tt\_news with the andWhere clause (see the property "extension" in the reference on page 8). .. _Samples: Samples ------- .. _Display-news-of-the-current-day-only: Display news of the current day only ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The andWhere statement from below will display news only, if they are published today. plugin.tt\_news.extensions.ttnews\_selectconf { andWhere ( tt\_news.datetime >= (UNIX\_TIMESTAMP() - (UNIX\_TIMESTAMP() % 86400) + 7200) AND tt\_news.datetime < (UNIX\_TIMESTAMP() - (UNIX\_TIMESTAMP() % 86400) - 86400 + 7200) ) } Be aware: if you are customising tt\_news by TypoScript and nit by a plugin, you have to configure your tt\_news within the page object like in the snippet below: page.10.default.subparts.content.20.extensions.ttnews\_selectconf { ... } Probably the 7.200 in the snippet above has to do with the properties of the current server. 7.200 seconds are two hours. Thanks to Michael Langmedia.design `http://www.mediadesign-ffm.de `_ for the code snippet. .. _Display-latest-news-only-configured-for-selected-plugins: Display latest news only configured for selected plugins ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The andWhere statement from below will display latest news only, published from today. The andWhere statement has an effect only for plugins with the uids 791 and 2558. The andWhere statement is usefull especially for an event calendar. plugin.tt\_news { extensions { ttnews\_selectconf { csvPluginsOnly = 2558, 791 andWhere ( tt\_news.datetime >= (UNIX\_TIMESTAMP() - (UNIX\_TIMESTAMP() % 86400) + 7200) ) } } } Be aware: if you are customising tt\_news by TypoScript and nit by a plugin, you have to configure your tt\_news within the page object like in the snippet below: page.10.default.subparts.content.20.extensions.ttnews\_selectconf { ... } Probably the 7.200 in the snippet above has to do with the properties of the current server. 7.200 seconds are two hours. Thanks to Michael Langmedia.design `http://www.mediadesign-ffm.de `_ for the code snippet. .. _Debug-Query: Debug Query ^^^^^^^^^^^ For developers only. Should delivers the start time of today like 2015-08-30 00:00:00 SELECT FROM\_UNIXTIME(UNIX\_TIMESTAMP() - ((UNIX\_TIMESTAMP() % 86400) + 7200)) Should delivers the start time of tomorrow like 2015-08-31 00:00:00 SELECT FROM\_UNIXTIME(UNIX\_TIMESTAMP() - ((UNIX\_TIMESTAMP() % 86400) - 86400 + 7200)) .. _Reference: Reference --------- .. ### BEGIN~OF~TABLE ### .. _Extensions-ttnews-selectConf: Extensions.ttnews-selectConf ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. container:: table-row Property Extensions.ttnews-selectConf Data type Array (select) Description Configuration by overriding (or manipulating with stdWrap) any of the clauses described below in the selectsection. Add the extension array to the typoscript of the array plugin.tt\_news. Configure the andWhere value. The example below effects that only tt\_news items will be displayed which are ownde by the fe\_user with the id 85. **Example:** :: plugin.tt_news { extensions { ttnews_selectconf { andWhere = tt_news.crfeuser_id = 85 } } } In the following example only news items which is older than field\_date will be shown – but only as long as field\_specific is not set. When field\_specific is set, only news items from a list of uids of field\_specific will be displayed. **Example with stdWrap:** :: plugin.tt_news.extensions.ttnews_selectconf { andWhere { dataWrap = tt_news < {field:field_date} if.isFalse.data = field:field_specific } udInList.data = field:field_specific } Default See the example .. ###### END~OF~TABLE ###### .. _select: select ^^^^^^ These are the SQL-select statements which are available. It's important to notice though, that many of them will not be available in every display mode as they are overwritten internally in the tt\_news code. Also you might get unexpected results in some situations if you mess too much with the current values. The andWhere statement doesn't seem to be used by tt\_news (extensions extending tt\_news might), so you can relative safely use this one without worrying if it will be overwritten. .. ### BEGIN~OF~TABLE ### .. _uidInList: uidInList """"""""" .. container:: table-row Property uidInList Data type *list of page\_id* /stdWrap Description Default .. _pidInList: pidInList """"""""" .. container:: table-row Property pidInList Data type *list of page\_id* /stdWrap Description Default .. _recursive: recursive """"""""" .. container:: table-row Property recursive Data type int /stdWrap Description Recursive levels for the pidInList Default 0 .. _orderBy: (orderBy) """"""""" .. container:: table-row Property (orderBy) Data type *SQL-orderBy* /stdWrap Description Without "order by"! Eg. "sorting, title" **Notice:** Not available in LATEST/LIST/SEARCH/XML mode Default .. _groupBy: (groupBy) """"""""" .. container:: table-row Property (groupBy) Data type *SQL-groupBy* /stdWrap Description Without "group by"! Eg. "Ctype" **Notice:** Not available in LATEST/LIST/SEARCH/XML mode Default .. _max: max """ .. container:: table-row Property max Data type int /stdWrap Description Max records **Special keyword:** "total" is substituted with count(\*) Default .. _begin: begin """"" .. container:: table-row Property begin Data type int /stdWrap Description Begin with record number *value* **Special keyword:** "total" is substituted with count(\*) Default .. _where: where """"" .. container:: table-row Property where Data type *SQL-where* /stdWrap Description Without "where"!, Eg. " (title LIKE '%SOMETHING%' AND NOT doktype) " Default .. _andWhere: andWhere """""""" .. container:: table-row Property andWhere Data type *SQL-where* /stdWrap Description Without "AND"!, Eg. "NOT doktype". Default .. _languageField: languageField """"""""""""" .. container:: table-row Property languageField Data type string /stdWrap Description If set, this points to the field in the record which holds a reference to a record in sys\_language table. And if set, the records returned by the select-function will be selected only if the value of this field matches the $GLOBALS[“TSFE”]->sys\_language\_uid (which is set by the config.sys\_language\_uid option) Default .. _selectFields: (selectFields) """""""""""""" .. container:: table-row Property (selectFields) Data type string /stdWrap Description List of fields to select, or “count(\*)”. **Notice:** Not available in LATEST/LIST/SEARCH/XML mode Default .. _join: join """" .. container:: table-row Property join leftjoin rightjoin Data type string /stdWrap Description Enter tablename for JOIN , LEFT OUTER JOIN and RIGHT OUTER JOIN respectively. Default .. ###### END~OF~TABLE ###### .. _Helpful-suggestions-and-bug-reports: Helpful suggestions and bug reports ----------------------------------- .. _New-Features-and-Bug-Reports: New Features and Bug Reports ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ You are welcome to post any question, bug or code snippet on TYPO3 forge.Here you find feature announcements and bug reports.See `http://forge.typo3.org/projects/extension-ttnewsselectconf `_ .. _Further-Information: Further Information ------------------- .. _Other-extensions-published-by-Die-Netzmacher: Other extensions published by Die Netzmacher ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - |img-6| +AOE Linkhandler Configurator: Configure the AOE linkhandler supported by userinterfaces. Out-of-the-box templates for cal, org, tt\_news and tt\_products. Don't edit page TSconfig any longer. `http://typo3.org/extensions/repository/view/linkhandlerconf/ `_ - |img-7| autositemap: A smart site-map optimised for the footer. It groups menus in columns. Great menus will get two columns. Configuration is based on TypoScript HMENU. `http://typo3.org/extensions/repository/view/autositemap/ `_ - |img-8| Browser – TYPO3 without PHP. Develop your TYPO3 extension 8 times faster! You need one line TypoScript for a result list with a search form, a record browser and an index browser. Images are wrapped self-acting. SEO, Search Engine Optimization, is integrated. `http://typo3.org/extensions/repository/view/browser/ `_ - |img-9| Caddy – the TYPO3 shopping cart. You can use it for your own needs. You need a database with products or any other items only. You can install Caddy out of the box with one mouse click – see Quick Shop below. `http://typo3.org/extensions/repository/view/caddy/ `_ - |img-9| Deal! – TYPO3 Quick Shop interface for the marketplace ebay. Manage all items with TYPO3 and publish it on ebay. Amazon is under construction. `http://typo3.org/extensions/repository/view/deal/ `_ - |img-10| Flip it! offers lovely and smooth page flip transitions. It enables you to run over pages in PDF documents like in a real magazine. It is based on flash. Flipt it! can convert PDF documents to swf files automatically. `http://typo3.org/extensions/repository/view/flipit/ `_ - |img-11| Jobmarket is a catalogue with job offers. Views, the a-z-browser, the page-browser, the search, social bookmarks and a lot of other stuff can configured by the Browser plugin with the mouse. Job Market hasn't any PHP code, it should be easy to adapt it to your needs. `http://typo3.org/extensions/repository/view/job\_market/ `_ - |img-12| Majordomo: For subcribing to and unsubscribing from a majordomo mailing list. `http://typo3.org/extensions/repository/view/majordomo/ `_ - |img-13| Organiser – TYPO3 for the lobby and the organisers. Handle news, events, staff, headquarters, locations, workshops and a calendar with one extension. Sell online tickets! Install the Organiser with one mouse click! `http://typo3-organiser.de/ `_ - |img-9| Quick Shop – the fastest shop in the history of TYPO3. Install it with one mouse click! Quick Shop is based on the browser (see above) and powermail. `http://typo3-quick-shop.de/ `_ - |img-14| PDF Controller: Easy to install. Add to your HTML page the PDF-controller-button. Link from the button to the controller. Adjust the controller by mouseclicks. The PDF Controller supports CSS 3. `http://typo3-pdfcontroller.de/ `_ - |img-15| Radial Search (Umkreissuche) – Enable the browsing through your data by geo location. 'Your data must have a latitude and a longitude. Address data can geocoded automatically by the Browser - TYPO3 without PHP. `http://typo3.org/extensions/repository/view/radialsearch/ `_ - |img-15| Route – Publish your routes with GoogleMaps or OpenStreetMap. Routes have points of interest (POI). You can categorise and filter both: routes and POI. Address data can geocoded automatically. `http://typo3.org/extensions/repository/view/route/ `_ - |img-16| seo\_dynamic\_tag: Search Engine Optimization for the title tag, the canonical tag and the meta tags author, description and keywords. Configuration by a user interface. `http://typo3.org/extensions/repository/view/seo\_dynamic\_tag/ `_ - |img-17| TSconfig Pages and Users by extManager (extkey: tsconf): Configure the the eight most commonly used TSconfig porperties with the mouse - like page tree uids, activated extended view, activated clipboard, ... `http://typo3.org/extensions/repository/view/tsconf/ `_ .. _Credits: Credits ------- - Thanks to Stig Nørgaard Færch (stig.at.8620.dk), who extended the andWhere clause with the stdWrap property. - Thanks to Michael Lang from media.design ( `http://www.mediadesign- ffm.de `_ ) for the code snippet "Error: Reference source not found" on page Error: Reference source not found Error: Reference source not found. - Thanks to Thomas Kakuschke ( `http://www.verkon.de `_ ) for supporting the update for tt\_news 3.0.x. .. _Change-log: Change log ---------- 3.7.1 **Feature** \* #i0002: ttnews\_selectconf.pluginOnly is moved to ttnews\_selectconf.csvPluginsOnly 3.7.0 **Feature** \* #i0001: Enable dependency on the current tt\_news plugin. 3.6.0 **Feature** \* #62778: Update for TYPO3 6.2 / tt\_news 3.6 0.2.2 **Bugfixing** \* #32334 - Automatic detection of tt\_news version fails in some casesby http://herrmann.at.die-netzmacher.de 0.2.1 **Bugfixing** Misspelled variable nameby http://herrmann.at.die- netzmacher.de 0.2.0: **Development** compatibility to tt\_news 3.0.\*by http://herrmann.at.die-netzmacher.de 0.1.2: **Sample** The manual is extended with the sample "Display news of the current day only" 0.1.1: **Development** The andWhere clause gots the stdWrap property. 0.0.3: **Status** : Changing from alpha to stable **Bugfixing** : ManualCorporate Design: Changing from think visually to Die Netzmacher 0.0.1: **Initial release** .. _Illustration-Index: Illustration Index ------------------ Illustration 1: Three tt\_news plugins. The thrird one displays only tt\_news, which are in the future. It is configured with ttnews\_selectconf 3 .. _Alphabetical-Index: Alphabetical Index ------------------ 15 .. ######CUTTER_MARK_IMAGES###### .. |img-1| image:: img-1.png .. :align: left .. |img-2| image:: img-2.jpeg .. :border: 0 .. :height: 20 .. :id: Grafik1 .. :name: Grafik1 .. :width: 69 .. |img-3| image:: img-3.png .. :border: 0 .. :height: 16 .. :id: graphics6 .. :name: graphics6 .. :width: 18 .. |img-4| image:: img-4.png .. :align: bottom .. :border: 0 .. :height: 265 .. :id: graphics5 .. :name: graphics5 .. :width: 265 .. |img-5| image:: data: :alt: Frame1 .. :align: bottom .. :id: Frame1 .. :name: Frame1 .. |img-6| image:: img-6.png .. :border: 0 .. :height: 16 .. :id: graphics1 .. :name: graphics1 .. :width: 18 .. |img-7| image:: img-7.png .. :align: bottom .. :border: 0 .. :height: 16 .. :id: graphics37 .. :name: graphics37 .. :width: 18 .. |img-8| image:: img-8.png .. :align: bottom .. :border: 0 .. :height: 16 .. :id: graphics2 .. :name: graphics2 .. :width: 18 .. |img-9| image:: img-9.png .. :align: bottom .. :border: 0 .. :height: 16 .. :id: graphics15 .. :name: graphics15 .. :width: 16 .. |img-10| image:: img-10.png .. :align: bottom .. :border: 0 .. :height: 16 .. :id: graphics48 .. :name: graphics48 .. :width: 18 .. |img-11| image:: img-11.png .. :align: bottom .. :border: 0 .. :height: 16 .. :id: Grafik5 .. :name: Grafik5 .. :width: 18 .. |img-12| image:: img-12.png .. :align: bottom .. :border: 0 .. :height: 16 .. :id: Grafik6 .. :name: Grafik6 .. :width: 18 .. |img-13| image:: img-13.png .. :align: bottom .. :border: 0 .. :height: 16 .. :id: graphics12 .. :name: graphics12 .. :width: 16 .. |img-14| image:: img-14.png .. :align: bottom .. :border: 0 .. :height: 16 .. :id: graphics4 .. :name: graphics4 .. :width: 18 .. |img-15| image:: img-15.png .. :align: bottom .. :border: 0 .. :height: 18 .. :id: graphics16 .. :name: graphics16 .. :width: 18 .. |img-16| image:: img-16.png .. :align: bottom .. :border: 0 .. :height: 16 .. :id: graphics17 .. :name: graphics17 .. :width: 16 .. |img-17| image:: img-17.png .. :align: bottom .. :border: 0 .. :height: 16 .. :id: graphics18 .. :name: graphics18 .. :width: 16