If you want to modify some global values of the TypoScript configuration, used for the news display, take a look at the "Constant Editor". To open it, click on "Web/Template" in the left-frame menu, choose the page with the root-template in the pagetree and select "Constant Editor" from the menu in the upper right corner.
To change any options you don't find there, take a look at the "TypoScript Object Browser" (TSOB):
More information about the TSOB can be found here: http://typo3.org/documentation/document-library/tutorials/doc_tut_quickstart/0.1.0/view/1/9/#id2855181
The default values for the tt_news TypoScript configuration are stored in the file setup.txt in one of the “static” folders in the extension directory. For a list of all possible (tt_news specific) options see the table "Reference" below.
Some options e.g. for "stdWrap" or "typolink" are explained in the Typo-Script Reference (TSref) which can be found here: http://typo3.org/documentation/document-library/references/doc_core_tsref/current/
File: | Description: |
|---|---|
pi/class.tx_ttnews.php | Main PHP-class used to display news. Called from a USER cObject with "userFunc = user_news->main_news" |
class.ext_update.php | This is the tt_news updater |
class.tx_ttnews_catmenu.php | This class renders the CATMENU in “tree” mode. |
class.tx_ttnews_tcemain.php | Class with that uses two hooks from class.t3lib_tcemain.php to prevent saving of news or category records which have categories assigned that are not allowed for the current BE user. |
class.tx_ttnews_treeview.php | This class builds the “category tree” in BE forms and checks for recursive categories |
class.tx_ttnews_itemsProcFunc.php | Contains the function, that adds “extra codes” to the “What to display” selector |
pi/news_template.tmpl | The table-based tt_news template file. |
pi/news_help.tmpl | Template, which is displayed when using the news extension without setting a value for "code" |
res/tt_news_languageMenu.php | Changed version of the example_languageMenu.php. This script keeps the link-variables from tt_news. |
res/example_itemMarkerArrayFunc.php | Example for processing user-defined Markers with the userfunction: “itemMarkerArrayFunc”. (See file for description and needed TS setup) |
res/example_amenuUserFunc.php | Example for processing the archive menu items by a user function (“amenuUserFunc”). The scripts divides the Archive menu to years. See file for description and needed TS setup. |
res/example_imageMarkerFunc.php | Example for processing the image(s) by a userfunction (“imageMarkerFunc”): adds different wraps to the images in single view (see comments in file for needed TS-settings) |
res/example_userPageBrowserFunc.php | Example for the pagebrowser userfunction (“userPageBrowserFunc”): this file includes two alternative pagebrowser-functions. With both pagebrowsers it is possible, to use html-code like images for the “next” and “previous” links. (See file for description and needed TS setup) |
folders:static/ts_new static/css static/ts_old static/rss_feed | these are the static extension templates: “CSS-based tmpl”,”default CSS-styles”,”table-based tmpl” and “RSS-feed (type=100)” |
pi/tt_news_v2_template.html | The new CSS based html-template |
res/tt_news_v2_styles.css | CSS styles for the new HTML template.(this file contains the same style information as the static ext-template “default CSS-styles”) |
res/rss_0_91.tmpl res/rss_2.tmpl res/atom_0_3.tmpl res/atom_1_0.tmpl res/rdf.tmpl | The xml templates for web feeds as RSS 0.91, RSS 2, RDF, Atom 0.3 and Atom 1.0. |
res/realurl_localconf.txt | Example Configuration for tt_news with RealUrl |
plugin.tt_news properties: TS configuration.
Property: | Data type: | Description: | Default: |
|---|---|---|---|
templateFile | resource | The HTML-template. (See examples: "pi/news_template.tmpl" and “pi/tt_news_v2_template.html” in the ext/tt_news folder). You can define a template for a complete pagetree, a certain page or even a single content element in your TS setup, in the Constant Editor or in the content.element. Example: plugin.tt_news {templateFile = fileadmin/my_templates/tt_news.html } | |
pid_list | string / stdWrap | The page id (pid), or list of pids of the folder(s), where your news are stored in (also known as “Starting point”). If this value is not set, and the “Starting point” field in the news content-element is also empty, the current page is used. Accepts multiple pids comma separated! Example: # clear the value plugin.tt_news.pid_list > # display news records located in page 582 & 584 plugin.tt_news.pid_list = 582,584 Note: “Starting Point / pid_list” has nothing to do with the “Storage Pid” (General Record Storage page), which is used for news-categories). | |
dontUsePidList | boolean | In sites with huge pagetrees where it is needed to have the news not in a few sysfolders but in the complete pagetree the check for the pid_list in tt_news can be a big performance eater because thousands of pages have to be checked for visibility and added to the sql query. With “dontUsePidList” enabled it is possible to disable the use of the parameters "pid_list" and "recursive" for tt_news related queries. Example: plugin.tt_news.dontUsePidList = 1 | |
recursive | Int / stdWrap | If this is given, the “pid_list” is extended by the number of recursive levels. Example: plugin.tt_news.recursive = 3 | |
code | string / stdWrap | Code to define, what the script does. Example: plugin.tt_news.code = LATEST | |
singlePid | int+ / stdWrap | Page id of the page where single news are displayed (name changed in tt_news 1.6.0). Here you can define a page to be used for display of a news item with the “SINGLE” template-part. This setting can also be done in the constant editor or directly in the content element. (the settings done directly in the content element will override settings you made by TS, but they will only affect these certain content element.) Example: # singlePid for a news element inserted by TS plugin.tt_news.singlePid = 590 Notice: setting at least one page with a SINGLE news content element as “singlePid” is required (since tt_news 1.3.0) -> if there's no “singlePid” defined the links that should point to the single view don't work. The old var-name “PIDitemDisplay” does not work for links to related news anymore (since tt_news 1.6.3) | |
allowCaching | boolean | Allow caching of news. | 1 |
limit | int+ / stdWrap | The maximum number of news-records showing in “LIST” view. | 7 |
latestLimit | int+ / stdWrap | The maximum number of news-records showing in “LATEST” view. | 3 |
alternatingLayouts | Int+ | Indicates how many alternating designs the news-script should expect in the html-template. Example: If you define a subpart like: "<!--###NEWS###--> ... <!--###NEWS###-->"this is used all the time. If you define a similar subpart: "<!--###NEWS_1###--> ... <!--###NEWS_1###-->" which might show another set of colors, this is used every second time instead of the default! This is because "alternateLayouts" is set to 2. If you define a similar subpart "<!--###NEWS_2###--> ... <!--###NEWS_2###-->" ... this will be used every third time IF (!) "alternateLayouts" is set to 3. If you do not set it to 3, the first two aternating designs will be used only. | 2 |
altMainMarkers | (array of strings) | Lets you specify alternative subpart markers for the various main template designs in the news template This is the list of main subparts you can override: Properties: TEMPLATE_LATESTTEMPLATE_LISTTEMPLATE_SINGLETEMPLATE_SINGLE_RECORDINSERTTEMPLATE_ARCHIVETEMPLATE_SEARCHTEMPLATE_ARCHIVE_NOITEMSTEMPLATE_HEADER_LISTTEMPLATE_CAT_RELATED /+ stdWrap Example: This example changes the main subpart marker for the regular news single item display from the default ###TEMPLATE_SINGLE### to the custom supplied design ###SINGLE_CUSTOM### (found in the same template HTML-file) plugin.tt_news { altMainMarkers.TEMPLATE_SINGLE = SINGLE_CUSTOM altMainMarkers.TEMPLATE_SINGLE.wrap = ### | ###} | |
compatVersion | version | Alters behavior of tt_news to be compatible with certain previous version. The value is not set by default, which means “current version”. Value must be a valid version string (i.e. include three numbers separated by period). Currently the following values are checked by extension:
|
Property: | Data type: | Description: | Default: |
|---|---|---|---|
useHRDates | boolean | Use human readable dates: This enables the use of the GETvars “year” and “month” for archive links instead of the non-readable vars “pS”, “pL” and “arc”. Now it's possible to have realUrls like this: http://www.example.com/news/archive/2005/04/ Hint: If you use realUrl, don't forget to adds these new vars to your localconf.php See section "RealUrl and SimulateStaticDocuments" in this manual for more information. | 0 |
useHRDatesSingle | boolean | Use “human readable dates” even for links pointing to the SINGLE view. Additionaly to “year” and “month” the links to the SINGLE view will show the “day”, so realUrls can look like this: | 0 |
useHRDatesSingleWithoutDay | boolean | Use “human readable Dates” for links to the SINGLE view without “day”, so realUrls can look like this: http://www.example.com/news/2005/04/this-is-awesome-too/ Example: plugin.tt_news {useHRDates = 1 useHRDatesSingle = 1 useHRDatesSingleWithoutDay = 1 } | 0 |
backPid | int+ | Here you can set the page id of the news list to which to return after looking at a single item. If you don't set a “backPid” the “Back” link in SINGLE view points to the last LIST or LATEST view. Usually the page that linked to the “SINGLE” view. If you have clicked to another related item, the “Back” link will still point to the last LIST page. You can override this behaviour by setting the parameter “backPid” in TS. This lets all “Back” links point to the page you configured there. | |
dontUseBackPid | boolean | If you enable this, you can prevent the use of the variables for dynamic “back-links” in links that point to the single-view. The advantage is, that all those links will look the same, what will f.e. prevent multiple indexing by the indexed search. (RealUrl Links will also look nicer without a “backPid”). The “back-link” in the SINGLE view will still work, but it will only point to a global “backPid” (f.e. the list view). See section "RealUrl and SimulateStaticDocuments" in this manual for more information. | 0 |
hscBackLink | boolean | If this is enabled the “Back to list” link in the SINGLE view will be parsed through the PHP function htmlspecialchars(). | 1 |
pageTypoLink | ->typolink | Additional typolink configuration for the links to news which are of type “links to internal pages” or type “external link”. With this setting you can override the global settings for targets in your page. Page id/external url parameter is loaded into “current” (TS data array). This option has no influence on links pointing to normal news records. The target of these links ist configured globally for the whole page. Example: if you have a page with frames and you want to open links to pages & external urls in a new browser window, use this setting: plugin.tt_news { pageTypoLink.target > pageTypoLink.target = _blank } | |
itemLinkTarget | string | Target for the links on category images that choose a certain category. This is only needed if you want to overwrite the global settings for “PAGET_TARGET” from constants. If you, f.e. use a LATEST element to control a LIST in another frame, set this to the frame name. | |
archiveTypoLink | ->typolink | Typolink configuration for links that point to the news archive. This is not a full featured “typolink config array” – only the attributes “parameter” and “addParams” are processed.
Example: # points to the page with id=34 and adds '&myvar=foo' to all links. plugin.tt_news {archiveTypoLink.parameter = 34 archiveTypoLink.addParams = &myvar=foo } | |
linkTitleField | string /stdWrap | Here you can define a field whose content will be inserted as “title” attribute in links pointing to the SINGLE view. Example: This will insert the content of the field “title” from the tt_news db-record as attribute “title” prepended with “go to ”. plugin.tt_news.displayList { linkTitleField = title linkTitleField.wrap = go to | } The final link should look like this: <a href=”news/single/title.html” title=”go to title”>the title</a> |
If you use the new css-based html-template you don't need to define “Global Wraps” and “Global Colors” because the complete visual formating is done with CSS-tyless. But of course those wraps and markers can be used for other purposes.
Property: | Data type: | Description: | Default: |
|---|---|---|---|
wrap1 | -> stdWrap | Global Wrap 1. This will be splitted into the markers ###GW1B### and ###GW1E###. Don't changes the input value, only wrap it in something. Example: plugin.tt_news.wrap1.wrap = <strong> | </strong> | |
wrap2 | -> stdWrap | Global Wrap 2 (see above) Note: the “Global Wraps” and the “Global colors” are not used in the TS setup for the css based template. | |
wrap3 | -> stdWrap | Global Wrap 3 (see above) | |
color1 | string /stdWrap | Value for ###GC1### marker (Global color 1) | |
color2 | string /stdWrap | Value for ###GC2### marker (Global color 2) | |
color3 | string /stdWrap | Value for ###GC3### marker (Global color 3) | |
color4 | string /stdWrap | Value for ###GC4### marker (Global color 4) |
Property: | Data type: | Description: | Default: |
|---|---|---|---|
searchPid | int+ | Page id where searchresults are displayed. If you want all news searches to go to a specific page, enter the PID here! NOTE: If you set this PID, all searchqueries will (must) be handled with a list content element with the code "SEARCH" on that page. | |
emptySearchAtStart | boolean | If this is set the “SEARCH” content element will show an empty list at start. Otherwise the full list of items is shown. | 1 |
searchEmptyMsg_stdWrap | ->stdWrap | stdWrap for the messages from the news-search: “no results” & “no searchword given”. |
Property: | Data type: | Description: | Default: |
|---|---|---|---|
noPageBrowser | boolean | Set this to “1” to completely disable the pagebrowser for all tt_news content elements in a page (can also be set directly in a content element to disable the pagebrowser only for this content element). Useful in combination with “excludeLatestFromList” or “listStartId”, set from the content element. | 0 |
latestWithPagebrowser | boolean | If this is set, the LATEST template can also contain a pagebrowser (you'll have to add one to your template first). If this is not set (default) the contents of LATEST are not influenced by the pagebrowser. | 0 |
usePiBasePagebrowser | boolean | Here you can configure if the pagebrowser for LIST and LATEST should be rendered by the TYPO3 core class “tslib_pibase” or if the internal pagebrowser from tt_news should be used (the pagebowser can also be renderd by a userfunction -> see “userPageBrowserFunc”). All pagebrowsers will be configured with the configuration array “pagebrowser.”. Since TYPO3 3.8.0 the internal pagebrowser from class.tslib_pibase offers some very nice features and its output is completely configurable (see below). If you use a TYPO3 version below 3.8.0 I recommend to use the pagebrowser from tt_news because it supports caching and it's also possible to use HTML (e.g. images) as “previous” and “more” links. | 0 |
pageBrowser | pageBrowser configuration array | Configuration array for the pagebrowser. All properties of the pagebrowser are configured in this array. |
This is the configuration array for the pagebrowser. All settings here start with “pageBrowser.”. The formating of the pagebrowser is done by CSS. See _CSS_DEFAULT_STYLE at the end of this list for an example.
Property: | Data type: | Description: | Default: |
|---|---|---|---|
maxPages | int+ | The maximum number of pages that are shown in the pagebrowser | 7 |
showPBrowserText | boolean | Here you can choose if the pagebrowser should show texts like “page 1, page...” in the pagelinks or if it should show only numbers. | 1 |
dontLinkActivePage | boolean | If this is set to 1 the current page is not linked linked in the pagebowser | 1 |
tableParams | string | If you didn't set a “browseLinksWrap” you can add parameters for the table that wraps the pagebrowser here. Example: (default setting) plugin.tt_news { pageBrowser {maxPages = 10 showPBrowserText = 1 tableParams = cellpadding=2 showResultCount = 1 } } Hint: If you want to change the default texts like “previous” to something else, you can do this with the TS var “_LOCAL_LANG” (see example at the end of this table). For the names of the language markers see: pi/locallang.xml but don't change the values in this file – they will be overwriiten when you update tt_news. You can change the language labels with the extension “llxmltranslate”. | |
showResultCount | 0,1,2 | In TYPO3 below 3.8.0 this configures if the result count (e.g.: “Displaying results 1 to 4 out of 22”) should be shown above the pagebrowser. In TYPO3 version 3.8.0 this var can have 3 values:
| 1 |
alwaysPrev | boolean | If this is enabled the “previous” link will always be visible even when the first page is displayed. | 0 |
showFirstLast | boolean | This is used as switch if the two links named "<< First" and "Last >>" will be shown and point to the first or last page. If “showFirstLast” is enabled “alwaysPrev” will be overwritten (set to 1). | 0 |
hscText | boolean | Here you can choose if the texts for the pagebrowser (eg: “next”, “Displaying reaults...”) will be parsed through the PHP function htmlspecialchars() or not. Disable this if you want to use HTML in the texts f.e. for graphical “next” and “previous” links. | 1 |
pagefloat | int / keyword | This defines were the current page is shown in the list of pages in the pagebrowser. If this var is an integer it will be interpreted as position in the list of pages. If its value is the keyword "center" the current page will be shown in the middle of the browse links. | 0 |
showRange | boolean | This var switches the display of the pagelinks from numbers to ranges f.e.: 1-5 6-10 11-15... instead of 1 2 3... | 0 |
browseBoxWrap | stdWrap | This is the wrap for the complete pagebowser (results and browse links). This wrap and the following ones are only available in TYPO3 3.8.0 or higher. Example: plugin.tt_news.pageBrowser {browseBoxWrap.wrap = <div class="browseBoxWrap">|</div> showResultsWrap.wrap = <div class="showResultsWrap">|</div> browseLinksWrap.wrap = <div class="browseLinksWrap">|</div> showResultsNumbersWrap.wrap = <span class="showResultsNumbersWrap">|</span> disabledLinkWrap.wrap = <span class="disabledLinkWrap">|</span> inactiveLinkWrap.wrap = <span class="inactiveLinkWrap">|</span> activeLinkWrap.wrap = <span class="activeLinkWrap">|</span> } | |
showResultsWrap | stdWrap | This wraps the text “Displaying results...”. | |
browseLinksWrap | stdWrap | Wrap for the browse links. | |
showResultsNumbersWrap | stdWrap | wrap for the numbers in the text: “Displaying results 1 to 4 out of 22 ”. | |
disabledLinkWrap | stdWrap | wrap for disabled links (f.e the “Last >>” link on the last page). | |
inactiveLinkWrap | stdWrap | wrap for inactive links (normal links). | |
activeLinkWrap | stdWrap | wrap for active links. |
Property: | Data type: | Description: | Default: |
|---|---|---|---|
archive | int | Use this if you want to configure a news LIST element inserted by TS to show only archived or non-archives items (this values will be overwritten by values set directly in the tt_news content element)
Example: This will setup a news content-element to display only archived items plugin.tt_news.archive = 1 Note: The LATEST and the AMENU elements are not affected by archive settings. Neither by the settings from TS nor from the Flexforms settings. | |
datetimeDaysToArchive | int (days) | If this is set, news are automatically in the archive after the given number of days has passed according to their initial datetime value. Note: this setting will have priority over a possibly given archivedate. For more information, see section “The Archive” in this manual Example: This handles all news records older than 30 days as archived. plugin.tt_news.datetimeDaysToArchive = 30 | 0 |
datetimeHoursToArchive | int (hours) | Same as datetimeDaysToArchive but for hours (can't be combined with datetimeDaysToArchive and datetimeMinutesToArchive). | 0 |
datetimeMinutesToArchive | int (minutes) | Same as datetimeDaysToArchive but for minutes (can't be combined with datetimeDaysToArchive and datetimeHoursToArchive). Note: If you are using datetimeHoursToArchive or datetimeMinutesToArchive son't forget to set the lifetime of the pagecache to a value that actually allows such short archiving periods | 0 |
enableArchiveDate | boolean | If set, the field "archivedate" is activated for selecting of news records. | 1 |
emptyArchListAtStart | boolean | If this is set, a news LIST element showing only archived items will show nothing at first view, without any given "periodStart"(pS) or "Lenght"(pL) from GET vars. The default is to show all archived items, starting from the first item in the archive. | |
reverseAMenu | boolean | If set, newer archive menu items are displayed first | 1 |
archiveMode | string | Determines which archive mode is used possible values: “month”, “year” or “quarter” (see “archiveTitleCObject”) Example: plugin.tt_news.archiveMode = month | month |
archiveTitleCObject | cObject | cObject that renders the title of the archive periods. Note that the data array (current) of the cObject is loaded with an array with the keys: “start” - starting time of period “stop” - ending time of period “quarter” - the quarter of the period (1-2-3-4) “count” - number of news items in this period Example: plugin.tt_news.archiveTitleCObject {10 = TEXT 10.field = start 10.strftime = %B - %Y } More advanced Example: This will display an AMENU in quarter periods like this: “Jan - Mar 2005: 3 items”. The selected archive period is displayed in bold text. plugin.tt_news { reverseAMenu = 0 archiveMode = quarter archiveTitleCObject > archiveTitleCObject = COA archiveTitleCObject {10 = COA 10 {10= TEXT 10 {field = start strftime = %b - wrap = <strong>| } 11 = TEXT 11 {field = stop strftime = %b %Y wrap = |</strong> } if {value.field = start equals.data = GPvar:tx_ttnews|pS } } 20 = COA 20 {10= TEXT 10 {field = start strftime = %b - wrap = } 11 = TEXT 11 {field = stop strftime = %b %Y wrap = } if {value.field = start equals.data = GPvar:tx_ttnews|pS negate = 1 } } } } | |
archiveMenuNoEmpty | boolean | If set, there will be no empty elements in the archive menu | 1 |
archiveHeader_stdWrap | ->stdWrap | stdWrap for the archive header. | |
archiveEmptyMsg_stdWrap | ->stdWrap | stdWrap for the message, that is displayed if no archived items are found at all |
Property: | Data type: | Description: | Default: |
|---|---|---|---|
general_stdWrap | ->stdWrap | The fields “bodytext”, “short” (subheader) and “links” will be processed by this stdWrap settings. Example: plugin.tt_news {general_stdWrap > general_stdWrap {parseFunc < tt_content.text.20.parseFunc } } This will clear any given “general_stdWrap” from default setup, and parse the content from tt_news through the same parseFunc as normal content like “text” or “text with image”.The handling of the content from RTE depends also on the global settings for the RTE and the RTE-transformations. See section “The Rich-Text-Editor” in this manual. | |
excludeLatestFromList | boolean | [deprecated] use "excludeAlreadyDisplayedNews" Set this to exclude news records shown in “LATEST” from appearing again in a “LIST” on the same page. Note: set this only for the page showing the “LIST” element. Otherwise it will affect all lists in your site. | 0 |
listStartId | int+ | [deprecated] use "excludeAlreadyDisplayedNews" Here you can set the number of the news item which will be displayed as first item in lists. This works also with the LATEST template. In combination with “limit” you can create complex combinations of several tt_news content elements on one page without displaying double news articles. Example: This will display a list of 3 news-articles starting from the 5th record, found in the db. (counting starts at zero) plugin.tt_news { listStartId = 4 limit = 3 } | |
excludeAlreadyDisplayedNews | boolean | This option allows you to place multiple news plugins on one page where each plugin itself takes care that no newsarticle is displayed twice. This feature makes the options "excludeLatestFromList" and "listStartId" obsolete. If "excludeAlreadyDisplayedNews" is enabled "excludeLatestFromList" and "listStartId" will be ignored. | 0 |
displayArchivedInLatest | boolean | By setting this to “1” you can display archived news in the “LATEST” template | 0 |
listOrderBy | string | Here you can set the “ORDER BY” part of the query for LIST and LATEST view. The special keyword ”random” will trigger randomized ordering of news in lists. Use this with care: The query parts, given from TS are only trimmed and not further validated -> if the field don't exist, you'll get a mysql-error Example: this will order the records by title, beginning with Z: plugin.tt_news.listOrderBy = title desc This will order the news by random: plugin.tt_news.listOrderBy = random Hint: if you set “asc” or ”desc” from the tt_news content-element (flexform) then the “asc/desc” part of listOrderBy will be ignored to prevent a mysql error. | datetime desc |
listGroupBy | string | The “GROUP BY” part of the query: if you set “listGroupBy = category” the string “category” is processed in a special way, because the tt_news_cat_mm table is not joined by default. This simulates the “group by category” functionality by joining the mm table to the tt_news table. (see line 745 in class.tx_ttnews.php). Restriction: This works only correct, if the news records have only one category assigned. Example: This will fill the object “lib.newsLatest” with a news content-element that displays only the newest item of each category lib.newsLatest < plugin.tt_news lib.newsLatest {code > code = LATEST catImageMode = 0 catTextMode = 1 listOrderBy = title asc listGroupBy = category } | |
title_stdWrap | ->stdWrap | stdWrap for display of the title field. | |
author_stdWrap | ->stdWrap | stdWrap for display of the author field. | |
email_stdWrap | ->stdWrap | stdWrap for display of the email field. | |
subheader_stdWrap | ->stdWrap | stdWrap for display of the news subheader (short). Example: plugin.tt_news.displayList.subheader_stdWrap {crop = 300 | ... | 1 ifEmpty.field = bodytext } This will crop the subheader after 300 characters and add “...” at the end of the text. (the third parameter for cropping only at the end of a word, works only with TYPO3 >=3.7.0). If the subheader field (short) is empty, the content of the bodytext field is taken instead. subheader_stdWrap is only active if the subheader is filled to the template marker ###NEWS_SUBHEADER### and not for the register “newsSubheader”. see section “Registers” in this manual for more information. | |
content_stdWrap | ->stdWrap | stdWrap for display of the news content (field: bodytext). | |
keywords_stdWrap | ->stdWrap | stdWrap for display of the news keywords. This wrap Is only active if the content of the field “keywords” is filled to the Template marker ###NEWS_KEYWORDS### and not for the register “newsKeywords”. see section “Registers” in this manual for more information. | |
links_stdWrap | ->stdWrap | stdWrap for the complete links section in the SINGLE view | |
linksHeader_stdWrap | ->stdWrap | stdWrap for header of the links section. | |
linksItem_stdWrap | ->stdWrap | stdWrap for a single link. | |
addInfo_stdWrap | ->stdWrap | This stdWrap wraps the complete list of additional data. It is inserted if there is at least one of the following items present: related news, files, links or “related news by category”. | |
useBidirectionalRelations | boolean | If you set a relation between two news-records and you enable this feature you'll see the relation in both records on the website. The relation back from the target-record to the source is inserted automatically. In the BE you won't see the relation. Example: plugin.tt_news.useBidirectionalRelations = 1 | |
usePagesRelations | boolean | If you enable this feature you can assign pages as related news. Those “related pages” are handled as news with type set to “link to internal page” so no changes to the TS of the getRelatedCObject are needed. | |
related_stdWrap | ->stdWrap | stdWrap for the list of related news. | |
relatedHeader_stdWrap | ->stdWrap | stdWrap for the header of the “related news” section. | |
alwaysShowRelated | boolean | Enable this if you want to show related news in LIST or LATEST, too. In the default setup this option is disabled to make the listview render faster. To see the related news in LIST or LATEST you have to add the markers ###TEXT_RELATED### and ###NEWS_RELATED### to your template for the listview. | |
getRelatedCObject | COA / ->stdWrap | Configuration for the related links in “SINGLE” view. The first case (10.default) configures the links to other news. The cases 10.1 and 10.2 configure the links to internal pages and external URLs (news types: article & external URL).You can set an individal wrap for each type of related news. The tmp object “tmp.5” is used to add an icon for each type of linkthe “tmp.20” object is the datetime of the related item which is appended after the link. Example: plugin.tt_news { ### Settings for Related News: related_stdWrap.wrap = <dl class="news-single-related">|</dl> relatedHeader_stdWrap.wrap = <dt>|</dt> # icon for related news tmp.5 = IMAGE tmp.5 {file = EXT:tt_news/ext_icon.gif file.width = 11 file.height = 12 wrap = | } # end-wrap for the getRelated objects tmp.20 = TEXT tmp.20 {field = datetime strftime = %d-%m-%y %H:%M wrap = - | } # Build the list of related news: getRelatedCObject = COA getRelatedCObject {# groupBy = orderBy = datetime desc 10 = CASE 10.key.field = type # settings for 'normal' related news 10.default = COA 10.default {wrap = <dd> | </dd> 5 < plugin.tt_news.tmp.5 10 = TEXT 10.field = title 10.typolink.parameter = {$plugin.tt_news.singlePid}10.typolink.additionalParams.data = register:newsAddParams 10.typolink.useCacheHash = 1 20 < plugin.tt_news.tmp.20 } # settings for related news, that point to internal pages 10.1 = COA 10.1 {wrap = <dd> | </dd> 5 < plugin.tt_news.tmp.5 5.file = EXT:tt_news/res/tt_news_article.gif 10 = TEXT 10.field = title 10.typolink.parameter.field = page 20 < plugin.tt_news.tmp.20 } # settings for related news, that point to external URLs 10.2 = COA 10.2 {wrap = <dd> | </dd> 5 < plugin.tt_news.tmp.5 5.file = EXT:tt_news/res/tt_news_exturl.gif 10 = TEXT 10.field = title 10.typolink.parameter.field = ext_url 20 < plugin.tt_news.tmp.20 } } } | |
getRelatedCObject.orderBy | string | Add an “ORDER BY”-clause to the query that finds the related news. Example: plugin.tt_news.getRelatedCObject.orderBy = title | |
getRelatedCObject.groupBy | string | Add an “GROUP BY”-clause to the query that finds the related news. Example: plugin.tt_news.getRelatedCObject.groupBy = type | |
noNewsIdMsg_stdWrap | ->stdWrap | stdWrap for the error message that is diplayed when a user enters the single-view page without the GET var &tx_ttnews[tt_news]. | |
noNewsToListMsg_stdWrap | ->stdWrap | stdWrap for the error message that appears if there are no new found to display in the list view. Example: plugin.tt_news.noNewsToListMsg_stdWrap.wrap = <p>|</p> | |
substitutePagetitle | boolean | if this is set, the pagetitle and the title for the page that is indexed by the indexed_search are substituted with the title of the news article. (works only in the “SINGLE”-view). Example: plugin.tt_news.substitutePagetitle = 1 | |
showRelatedNewsByCategory | boolean | Enable this if you want that the SINGLE view shows a list of news articles with the same category as the current article. If news with the same category are found, they will be rendered as LIST to the marker “###NEWS_RELATED_BY_CATEGORY###”. By default the code LIST causes tt_news to render the content to the template ###TEMPLATE_LIST### This can be changed to a userdefined template part which f.e contains only the titles of the records. See section “Related news by category” for an example. |
Property: | Data type: | Description: | Default: |
|---|---|---|---|
useMultiPageSingleView | boolean | This enables pagebreaks for the SINGLE view or is enabled automaticly when “maxWordsInSingleView” has a value. Pagebreaks are inserted after a certain amount of words or with the manually inserted “pageBreakToken”'. Example: This will enable pagebreaks for the single view if no value for “maxWordsInSingleView” exists. plugin.tt_news { useMultiPageSingleView = 1 } | 0 |
pageBreakToken | string | This will overwrite the default pagebreak token (<---newpage--->) with a different string. Example: This sets the pagebreak token to <break>. plugin.tt_news { pageBreakToken = <break> } | <---newpage---> |
maxWordsInSingleView | int+ | Insert pagebreaks automatically after a given amount of words. Can be configured globally or for a single content element. This can be disabled for news records individually by setting “no automatic pagebreaks for this record” . | 0 |
useParagraphAsPagebreak | boolean | Here you can configure that pagebreaks will be inserted after a paragraph (an empty line in the bodytext field after pressing enter) instead of inserting them after the first dot after “maxWordsInSingleView” was reached. Hint: If you enable this and set “maxWordsInSingleView” to a small value (e.g. 3) a paragraph will function as pagebreak token. | 0 |
singleViewPointerName | string | If you want to change the name of the GETvar that is used for the pointer of the pagebrowser in SINGLE view, it's possible to set this name here. Example: this will set the pointer in single view to 'page'. plugin.tt_news { singleViewPointerName = page } | sViewPointer |
subheaderOnAllSViewPages | boolean | By default the subheader is only displayed on the first page of a multipage SINGLE view. If this is not wanted the subheader can be configured to appear on all those pages by setting “subheaderOnAllSViewPages” to 1. | 0 |
appendSViewPBtoContent | boolean | The pagebrowser for the SINGLE view can be inserted into the content in two different ways: 1. There is a separate marker for the pagebrowser in SINGLE view: ###NEWS_SINGLE_PAGEBROWSER### 2. Alternatively it is possible to simply append the pagebrowser to the bodytext (###NEWS_CONTENT###) without using a special marker by setting “appendSViewPBtoContent” to 1. Example: This will append the pagebrowser to the end of the bodytext plugin.tt_news { appendSViewPBtoContent = 1 } | 0 |
Property: | Data type: | Description: | Default: |
|---|---|---|---|
imageCount | int+ | Number of images from the list of images to display. Example: This will supress images in list view. plugin.tt_news.displayList.imageCount = 0 | 1 |
imageWrapIfAny | wrap | If there is any image code returned, this wraps those images | |
image | ->imgResource ->stdWrap | Configurates the image(s) in news items. Example: plugin.tt_news.displayList.image {file.maxW = 120 file.maxH = 90 imageLinkWrap = 1 stdWrap.spaceAfter = 5 } see: TSref->imgResource | |
image.noImage_stdWrap | ->stdWrap | This allows you to set an image which is shown if no image is attached to the news article. Example: This will render an image with the text “No image” on it in the LIST view: plugin.tt_news.displayList.image.noImage_stdWrap { cObject = IMAGE cObject {wrap = file = GIFBUILDER file { XY = {$plugin.tt_news.listMaxW},{$plugin.tt_news.listMaxH}backColor = #ffffff 10 = TEXT 10 {text = No image fontSize = 14 niceText = 1 fontColor = #000000 offset = {$plugin.tt_news.listMaxW}/2-30, {$plugin.tt_news.listMaxH}/2+4} } } } | |
caption_stdWrap | ->stdWrap | stdWrap for display of the image caption(s). | |
firstImageIsPreview | boolean | If this is set to 1, the first image of a news article is handled as "preview image". This means this image is only displayed in LIST & LATEST view and not in SINGLE view. (if only one image is atached to the news item this parameter does not have any effect). Example: plugin.tt_news.firstImageIsPreview = 1 | |
forceFirstImageIsPreview | boolean | Works like firstImageIsPreview but always removes the first image from SINGLE view, even if only one image is attached. |
Property: | Data type: | Description: | Default: |
|---|---|---|---|
newsFiles | -> filelink | Here you can specify the options for the displaying and linking of files, attached to news items. See: TSref->filelink Example: (default configuration) plugin.tt_news { newsFiles_stdWrap.wrap = <dl class="news-single-files">|</dl> newsFilesHeader_stdWrap.wrap = <dt>|</dt> newsFiles {path = uploads/media/ icon = 1 stdWrap.wrap = <dd>|</dd> } } | |
newsFilesHeader_stdWrap | ->stdWrap | stdWrap for the header of the “attached files” section in your template. | |
newsFiles_stdWrap | ->stdWrap | stdWrap for the list of attached files |
Property: | Data type: | Description: | Default: |
|---|---|---|---|
date_stdWrap | ->stdWrap | Here you can set the date formating for the template-marker: ###NEWS_DATE###. Example: plugin.tt_news.displayList { date_stdWrap.strftime= %A %d. of %B %Y } This will display the date in news LIST content elements like this: “Sunday 15. of August 2004”. | |
time_stdWrap | ->stdWrap | Here you can set the time formating for the template-marker: ###NEWS_TIME###. Example: plugin.tt_news.displaySingle { time_stdWrap.strftime = %H:%M } This will display the time in news SINGLE content elements like this: “12:03”. | |
age_stdWrap | ->stdWrap | stdWrap for display of ages. Instead of the value “1” ( = display default strings for ages) you can also add your own names for minutes, hours, days and years: Example: This will change the output of the age in the SINGLE view to german names: plugin.tt_news.displaySingle {age_stdWrap.age = Minuten | Stunden | Tage | Jahre } Note: More about the stdWrap properties “strftime” and “age” can be found here: TSref->stdWrap | 1 |
textNewsAge_stdWrap | ->stdWrap | stdWrap for the age text: ( “age:”) |
Property: | Data type: | Description: | Default: |
|---|---|---|---|
useSubCategories | boolean | This enables the use of subcategories for selecting news for display in the FrontEnd. | |
displaySubCategories | boolean | This enables the display of subcategories in the FrontEnd. Example: plugin.tt_news {useSubCategories = 1 displaySubCategories = 1 } | |
catExcludeList | string | List of categories that should not be displayed in news articles in LIST, LATEST and SINGLE. | |
categoryMode | int | Use this, if you want to configure a news conetnt element, inserted by TS to display news by their categories (this value will be overwritten by values set directly in the news content-element).
Example: plugin.tt_news.categoryMode = -1 This will only display news with categories NOT selected in "categorySelection" Note: If the GETvar “&tx_ttnews[cat]=” is present, the selection from GETvars will have priority over the selection made in the content-element or by TS. | |
categorySelection | Int+ / list / ->stdWrap | If you want to display only new with certain categories in a news content element that is inserted by TS, set the selection with “categorySelection”. Note: To make this work you'll also have to set the categoryMode to 1 (=show selected) Example: # this will only show items with category 2 or 3 plugin.tt_news {categorySelection = 2,3 # show only selected categories categoryMode = 1 } “categorySelection” has also stdWrap properties.If you want to get the selected categories f.e. from the “getText” object something like this should work: plugin.tt_news {categorySelection.data = register:whatever } | |
catImageMode | int | Display mode for category images.
Example: # don't display any category images plugin.tt_news.catImageMode = 0 | 2 |
catTextMode | int | Display mode for category texts (titles).
Example: # don't display any category titles plugin.tt_news.catTextMode = 0 | 1 |
catSelectorTargetPid | Int+ | Set this value to let the links from categories in “catSelector” mode point to another page than the current page (catImageMode or catTextMode = 3). | |
latestWithCatSelector | boolean | By default, the “LATEST” element is not influenced by the selection made with the catselector. If you want to allow this, set this var to 1. Example: plugin.tt_news.latestWithCatSelector=1 | |
amenuWithCatSelector | boolean | The same as above for the “AMENU” element. | |
category_stdWrap | ->stdWrap | stdWrap for the complete category section. | |
categoryTitles_stdWrap | ->stdWrap | stdWrap for all category titles. | |
categoryImages_stdWrap | ->stdWrap | stdWrap for all category images. | |
categoryTitleItem_stdWrap | ->stdWrap | stdWrap for a single category title. | |
subCategoryTitleItem_stdWrap | ->stdWrap | stdWrap for a single subcategory title. Example: plugin.tt_news { displayList {subCategoryImgItem_stdWrap.wrap = <span class="scat-img">|</span> subCategoryTitleItem_stdWrap.wrap = <span class="scat-title">|</span> } } | |
categoryImgItem_stdWrap | ->stdWrap | stdWrap for a single category image. | |
subCategoryImgItem_stdWrap | ->stdWrap | stdWrap for a single subcategory image. | |
catImageMaxWidth | int+ | Maximum width of category images. | 20 |
catImageMaxHeight | int+ | Maximum height of category images. | 20 |
catTextLength | int+ | Maximum length in characters of all category titles. Note: This var makes only sense, when using the catTextMode 1 (= display but don't link). If the category title is linked, the chars of the html code are counted also and the cropping causes broken HTML. | |
maxCatImages | int+ | Maximum number of displayed category images. | |
maxCatTexts | int+ | Maximum number of displayed category texts. | |
catOrderBy | string | By default categories that are assigned to a news-record are displayed on the website in the same order as they are ordered in the category field in the tt_news db-record. If you want to change this, you can set “catOrderBy” to f.e. “title” to order the categories alphabetically. The ordering of categories in the CATMENU content element is influenced by this parameter, too, but it's of course (who wonders? ;-)) possible to set the ordering of categories in the catmenu different from the ordering in LIST, LATEST or SINGLE (see Example 2). Example: # this will order the categories in news articles and in the CATMENU alphabetically plugin.tt_news {catOrderBy = title } Example 2: plugin.tt_news { # order categories in LIST by uid displayList.catOrderBy = uid # order categories in SINGLE and CATMENU by title displaySingle.catOrderBy = title displayCatMenu.catOrderBy = title } Note: The value you insert here is only trimmed and not further validated. If you enter a field that does not exist in the tt_news table, you'll get a MySQL error. | |
useSPidFromCategory | boolean | Here you can enable the use of the singlePid which is configured in the category record. | 0 |
categoryDivider | string | The value inserted here appears between the category titles which are shown in news records. | , |
categoryDivider_stdWrap | ->stdWrap | This is the stdWrap for the categoryDivider. Since it is not possible to insert a space with a string value in TypoScript this wrap is used to insert the space after the comma in the default setup. Example: # This is the default setup plugin.tt_news { categoryDivider = , categoryDivider_stdWrap.noTrimWrap = || | } |
This is the configuration array for the content element “CATMENU”. All settings here start with “displayCatMenu.”
Property: | Data type: | Description: | Default: |
|---|---|---|---|
mode | string | The “render mode” for the catmenu. Currently the following modes are supported:
Example: plugin.tt_news { displayCatMenu {mode = nestedWraps } } | tree |
excludeList | string | Uid (or comma seperated list of uids) of the categories which should not appear in the category menu | |
includeList | string | Uid (or comma seperated list of uids) of the categories which should be shown in the category menu. Example: plugin.tt_news {displayCatMenu.excludeList = displayCatMenu.includeList = } | |
catmenuIconMode | int | The “catmenuIconMode” defines how icons in the catmenu will be displayed:
| 0 |
catmenuIconPath | string | The icon files will be prepended by this path | |
catmenuIconFile | imgResource | This configures the userdefined icons in “catmenuIconMode” set to 1 or 2 Example: plugin.tt_news { displayCatMenu {catmenuIconMode = 2 catmenuIconFile = EXT:tt_news/res/arrow.gif catmenuIconFile {width = 18 height = 16 } } } For “catmenuIconMode” 1 no file is needed only width and height | |
insertDescrAsTitle | boolean | If this is enabled the content of the field “description” from the category db-record will be inserted as “alt” and “title” attributes to the catselector links. | 1 |
catmenuNoRootIcon | boolean | disables the “root” icon in mode “tree”. | 1 |
catmenuRootIconFile | imgResource | Imagefile for the root icon (see “catmenuIconFile”) | |
catmenu_stdWrap | ->stdWrap | stdWrap for the complete CATMENU. Example: plugin.tt_news { displayCatMenu {catmenu_stdWrap.wrap = <div class="news-catmenu">|</div> } } | |
catmenuHeader_stdWrap | ->stdWrap | stdWrap for the header of the CATMENU. Example: plugin.tt_news { displayCatMenu {catmenuHeader_stdWrap.wrap = <p class="news-catmenu-header">|</p> } } | |
catmenuItem_ACT_stdWrap | ->stdWrap | stdWrap for an active link in the CATMENU. Example: plugin.tt_news { displayCatMenu {catmenuItem_ACT_stdWrap.wrap = <strong>|</strong> catmenuItem_NO_stdWrap.wrap = | } } | |
catmenuItem_NO_stdWrap | ->stdWrap | stdWrap for a normal link in the CATMENU. | |
catmenuLevel[#]_stdWrap | ->stdWrap | stdWrap for a certain level in the CATMENU in mode “nestedWraps”. Substitute “[#]” with the number of the level (1 is first level). Example: plugin.tt_news { displayCatMenu {catmenuLevel1_stdWrap.wrap = <div class="level1">|</div> catmenuLevel2_stdWrap.wrap = <div class="level2">|</div> catmenuLevel3_stdWrap.wrap = <div class="level3">|</div> catmenuLevel4_stdWrap.wrap = <div class="level4">|</div> catmenuLevel5_stdWrap.wrap = <div class="level5">|</div> } } |
The category rootline is rendered to the template marker ###NEWS_CATEGORY_ROOTLINE###. All settings here start with “catRootline.”
Property: | Data type: | Description: | Default: |
|---|---|---|---|
showCatRootline | boolean | If this is enabled tt_news will show the category rootline | 0 |
catRootline_stdWrap | ->stdWrap | StdWrap for the complete category rootline. Example: plugin.tt_news {# settings for the category rootline catRootline {showCatRootline = 1 catRootline_stdWrap.wrap = <div class="news-catRootline">|</div> # if titles are linked the link points to the page which is configured as category shortcut linkTitles = 1 title_stdWrap.wrap = divider = > } } | |
linkTitles | boolean | Switch which configures if categories are linked or not. | 1 |
title_stdWrap | ->stdWrap | stdWrap for a single category title in the category rootline | |
divider | string | This string is inserted between the category titles in the category rootline |
Property: | Data type: | Description: | Default: |
|---|---|---|---|
rss091_tmplFile | resource | XML template for RSS 0.91 feed | |
rss2_tmplFile | resource | XML template for RSS 2.0 feed | |
atom03_tmplFile | resource | XML template for Atom 0.3 feed | |
atom1_tmplFile | resource | XML template for Atom 1.0 feed | |
rdf_tmplFile | resource | XML template for RDF feed | |
xmlFormat | string | Defines the format of the news feed. Possible values are: rss091, rss2, rdf, atom03 and atom1 | rss2 |
xmlTitle | string | The title of your news feed. (required for rss091, rss2, rdf, atom03, atom1) | |
xmlLink | string | The link to your hompage. (required for rss091, rss2, rdf, atom03, recommended for atom1) | |
xmlDesc | string | The description of your news feed. (required for rss091, rss2, rdf, optional for atom03, optional for atom1) | |
xmlLang | string | Your site's language. A list of allowable is available at http://backend.userland.com/stories/storyReader$16 (required for rss091, optional for rss2, recommended for atom03, not available for rdf and atom1) | en |
xmlIcon | string | Provide an icon for your news feed with preferred size of 16x16 px, can be gif, jpeg or png. (required for rss091, optional for rss2 and rdf, not available for atom03 and atom1) Example: plugin.tt_news.displayXML { xmlIcon = fileadmin/images/feedicon.gif } | |
xmlCopyright | string | Copyright notice for content in the channel. Maximum length is 100 (optional for rss091, rss2, atom03, atom1, not available for rdf) | |
xmlManagingEditor | string | The email address of the managing editor of the channel, the person to contact for editorial inquiries. Maximum length is 100. (optional for rss091, rss2, not available for rdf, atom03 and atom1) | |
xmlWebMaster | string | The email address of the webmaster for the channel, the person to contact if there are technical problems. Maximum length is 100. (optional for rss091, rss2, not available for rdf, atom03 and atom1) | |
xmlLastBuildDate | boolean | The last time the content of the channel changed. (when the latest news was added) (optional for rss091, rss2, required for atom03 and atom1, not available for rdf) | 1 |
xmlLimit | int+ | Limit for news records in the RSS/XML feed Example: plugin.tt_news.displayXML { xmlLimit = 10} | 10 |
xmlCaching | boolean | Allow caching for the RSS/XML feed | 1 |
dontInsertSiteUrl | boolean | If set, the links in the XML feeds are not preprended with the siteUrl. | 0 |
xmlDeclaration | string | In XML-feeds from tt_news the template marker ###XML_DECLARATION### will be substituted with this string: <?xml version="1.0" encoding="iso-8859-1"?> The “encoding” attribue will be substituted with the globally configured charset (config.metaCharset). If you if you want to override the default xml-declaration with a given string, you can do this by setting an own xmlDeclaration. Example: plugin.tt_news.displayXML { xmlDeclaration = <?xml version="1.0" encoding="utf-8"?>} |
Property: | Data type: | Description: | Default: |
|---|---|---|---|
sys_language_mode | string | This configures how not-translated new-records are handled. possible values: “strict”. (if a value for “page.config.sys_language_mode” is given and “plugin.tt_news.sys_language_mode” is empty, tt_news will take this value) Default is to display the record in the default language (sys_language_uid=0) if there is no translation available. Setting the “sys_language_mode” to “strict” will only display records in the choosen language. Example: plugin.tt_news.sys_language_mode = strict see: TSref->CONFIG -> search: “sys_language_mode” | |
showNewsWithoutDefaultTranslation | boolean | If you have a website with two languages (english = default, german = 1) than the default is not to show news in the german translation that have no parent in the default language. With the the option “showNewsWithoutDefaultTranslation” it is possible to disable this behaviour. | 0 |
showLangLabels | Display language labels and/or flags in news articles. The language labels are inserted in the html-template with the marker ###NEWS_LANGUAGE### . Example: plugin.tt_news {showLangLabels = 0 showFlags = 1 flagImage {file.maxW = 16 } } | 0 | |
showFlags | boolean | Display flag Image. | 0 |
flagPath | string | Path to the flag-images. If this is empty, the flags from “typo3/gfx/flags/” are taken | |
flagImage | -> IMAGE | Flag image configuration array. |
Property: | Data type: | Description: | Default: |
|---|---|---|---|
defaultCode | string | If “code” (see above) is empty the value of defaultCode is taken instead. By default it's not set and a help screen will appear if “code” is also empty. By setting this parameter you can also define a different template part for displaying news-records with the “insert records” content element. Example: This will render records in the “insert records” content element with the LIST template (default is: SINGLE_RECORD_INSERT). plugin.tt_news.defaultCode = LIST | |
displayCurrentRecord | boolean | If set, certain settings are manipulated in order to let the script render one or more single items as an "insert records" content-element. You can change between the SINGLE and the LIST view to display the items by setting the "defaultCode". The default template for this is a slightly changed version of the SINGLE template called "TEMPLATE_SINGLE_RECORDINSERT". | |
itemMarkerArrayFunc | string | If this is set to a valid function name, the marker array from class tx_ttnews is processed by a user-defined function. See file: “res/example_itemMarkerArrayFunc.php” for description and needed TS setup. | |
newsAmenuUserFunc | string | If this is set to a valid function name, the archive menu items are processed by a user function. See file: “res/example_amenuUserFunc.php” for an example of how to divide the Archive menu to years by a user function. | |
imageMarkerFunc | string | Use this to process the image markers with your own userfunction. See file: “res/example_imageMarkerFunc.php” for an example, that wraps the images for the news single view in different wraps. -> useful for positioning the images by CSS. | |
userPageBrowserFunc | string | With this userfunction you can substitute the build-in pagebrowser from tt_news with your own script. See file: “res/example_userPageBrowserFunc.php” for examples. | |
_LOCAL_LANG | string | Here you can overwrite values from the language file. See ext/tt_news/pi/locallang.xml for a list of all translated words.Example: plugin.tt_news { _LOCAL_LANG.de {latestHeader = Das Allerneuste vom Neuen! more = [weiterlesen...] pi_list_browseresults_displays = Sie sehen Artikel ###SPAN_BEGIN###%s bis %s</span> von ###SPAN_BEGIN### %s</span> }} | |
_CSS_DEFAULT_STYLE | string | Default CSS-styles for tt_news. Example: plugin.tt_news {_CSS_DEFAULT_STYLE ( /* example styles for the pagebrowser*/ .tx-ttnews-browsebox TD { font-size: 10px; } .tx-ttnews-browsebox-strong, .tx-ttnews-browsebox-SCell { font-weight: bold; } .tx-ttnews-browsebox-SCell { background-color: #EEE; } )} |
Q: There are 3 ways (constants, setup and flexforms) to set a value for the e.g. “SINGLE view” page. If I set all 3, which will win?A: The flexform value from the tt_news content element will override values from TypoScript. In TS values set directly in the setup field will override values from the constant editor. To see the current TS settings for a page, click on “Template” in the “Web” menu, choose this page in the pagetree, and open the “TypoScript Object Browser” on this page. (See screenshot at the beginning of this chapter).
### News LATEST in left column
lib.newsLatest < plugin.tt_news
lib.newsLatest {code >
code = LATEST
pid_list >
pid_list = 2,3 # the pids of the pages where your news are stored
catImageMode = 0
catTextMode = 0
}
# add tmp to page Object
page.subparts.NEWSLATEST < lib.newsLatest
If you don't use subparts in your TS, you can use something like this to insert "tmp.newsLatest" to your page object:
page.10.43 < lib.newsLatest
### SINGLE news with graphical header
plugin.tt_news { displaySingle { title_stdWrap.cObject = IMAGE
title_stdWrap.cObject.file = GIFBUILDER
title_stdWrap.cObject.file { XY = [10.w]+2,30
backColor = #FFFFFF
10 = TEXT
10.text.field = title
10.text.case = upper
10.fontSize = 18
10.fontFile = t3lib/fonts/verdana.ttf
10.fontColor = #769400
10.offset = 1,20
10.antiAlias = 0
10.niceText = 1
}
}
}
[depreciated] Since tt_news 2.2.0 the category selector is a normal content element: CATMENU. So take this as a general TS example – maybe useful for other purposes.
This will insert a simple list of all tt_news categories from configurable folders to the left content-column. Clicking on a category link will display only news with the selected category. (highlights the current category)
### news Category Selector
page.10.subparts.left_content >
page.10.subparts.left_content = CONTENT
page.10.subparts.left_content {table = tt_news_cat
select {# the category folder(s)
pidInList = 124
}
renderObj = COA
renderObj.wrap = <div class="news-archive-item">|</div>
renderObj {10 = TEXT
10.field = uid
10.dataWrap = <a href=index.php?id={TSFE:id}&tx_ttnews[cat]= | >10.insertData = 1
20 = TEXT
20 {field = title
wrap = <strong>|</strong>
if {value.field = uid
equals.data = GPvar:tx_ttnews|cat
}
}
21 = TEXT
21 {field = title
wrap = |
if {value.field = uid
equals.data = GPvar:tx_ttnews|cat
negate = 1
}
}
30 = TEXT
30.value = </a><br />
}
}
Insert the following lines to the setup field of an ext-template at the page where you want to display the latest news item in SINGLE view if no SINGLE view for another record was requested:
# hide the "no news id" message
plugin.tt_news._LOCAL_LANG.default.noNewsIdMsg =
# set the tt_news singlePid to the current page
plugin.tt_news.singlePid = 977
# fill the content of the main-column to a tmp.object
tmp.pagecontent < page.10.subparts.contentarea
# clear the content of the main column
page.10.subparts.contentarea >
# build a new object for this column as content-object-array
page.10.subparts.contentarea = COA
page.10.subparts.contentarea {10 = CONTENT
10.table = tt_news
10.select {# insert the pids of all pages from where you want to fetch news.
# the recursive-field has no influence on this selection
pidInList = 1078,1079,1080,1081,1082,1083,1084
orderBy = datetime desc
max = 1
}
# insert the object “10.” only if there is no SINGLE news selected
10.stdWrap.if.isFalse.data = GPvar:tx_ttnews|tt_news
# re-insert the normal pagecontent to the page
20 < tmp.pagecontent
}
The page in this example contains 2 columns. The news LIST is located in the left column. the main column (page.10.subparts.contentarea) contains a SINGLE news content-element.
With a small TypoScript condition it's possible to show the news SINGLE view at the same page where the LIST is. This has some advantages for realUrl links:
Insert this to the setup field:
# clear the code field
plugin.tt_news.code >
plugin.tt_news.code = LIST
# prevent indexing of the LIST view
config.index_enable = 0[globalVar = GP:tx_ttnews|tt_news > 0]
# set code to SINGLE if the GETvar tx_ttnews[tt_news] exists plugin.tt_news.code = SINGLE
# enable indexing of the SINGLE view
config.index_enable = 1[global]# clear main content in page object
page.10.subparts.content >
# load tt_news as content to the page object
page.10.subparts.content < plugin.tt_news
Add one of the following lines to your TS-Setup field:
# this will remove the complete <p> tag from all news content elementsplugin.tt_news { general_stdWrap {parseFunc.nonTypoTagStdWrap.encapsLines.nonWrappedTag >
}
}
# this will remove the complete <p> tag from ALL content elementslib.parseFunc_RTE.nonTypoTagStdWrap.encapsLines.nonWrappedTag >
# This will remove the <p class="bodytext"> wrap from subheader, author and links
plugin.tt_news {# unset general_stdWrap
general_stdWrap >
displayList {# add a wrap to the subheader
subheader_stdWrap.wrap = <p>|</p>
}
displaySingle {# add parseFunc to the subheader
subheader_stdWrap.parseFunc < lib.parseFunc_RTE
# prevent adding of <p> tags
subheader_stdWrap.parseFunc.nonTypoTagStdWrap.encapsLines.nonWrappedTag >
# add parseFunc to the bodytext
content_stdWrap.parseFunc < lib.parseFunc_RTE
# add parseFunc to the links field
linksItem_stdWrap.parseFunc < lib.parseFunc_RTE
# prevent adding of <p> tags
linksItem_stdWrap.parseFunc.nonTypoTagStdWrap.encapsLines.nonWrappedTag >
}
}
Registers can be considered as a clipboard which is in this case used to traverse values from the tt_news class to the TypoScript setup.
Name: | Description: |
|---|---|
newsMoreLink | This register is filled with the html-string for the more-link example: <a href="single/article/roeta-aula-dum/">more</a> |
newsCategoryUid | This register holds the Uid of the category of the current news record. if there is more than on category assigned, the uid of that one is choosen that is first in the list of categories of the news record. |
newsKeywords | This register is filled with the value of the field “Keywords”. |
newsSubheader | This register is filled with the value of the field “Subheader” (short). |
If you want the “more”-link to appear inside the wrap of the subheader, you can use the stdWrap-function “append” to wrap the content of the register “newsMoreLink” to the subheader. Now the “more”-link should appear in the same line (and the same <p> tag) as the subheader. Example:
plugin.tt_news.displayList.subheader_stdWrap {append = TEXT
append.data = register:newsMoreLink
append.wrap = <span class=”myclass”>|</span>
}
With one more line of Typoscript the alternative “more” link can be made conditional – means: it will show up when the field “bodytext” contains something.
Example:
plugin.tt_news.displayList.subheader_stdWrap {
append = TEXT
append.data = register:newsMoreLink
append.wrap = <span class=”myclass”>|</span>
append.if.isTrue.field = bodytext
}
A register named “newsCategoryUid” is filled from the script with the uid of the first assigned category. You can access this register by TS to generate different wraps for different categories.Example:
plugin.tt_news.displayList { title_stdWrap.wrap = <div class="news-list-title-{register:newsCategoryUid}">|</div>title_stdWrap.insertData=1
}
You need a css-class for each category that contains the uid of the category in its name. for example:
.news-list-title-4 { background-color: #090;}The registers “newsKeywords” and “newsSubheader” can be used to fill values from the news record to the <meta> tags of the page with the SINGLE view on it. They are not filled in LIST and LATEST view.Example:
This example assumes, that you've installed the extension “Meta tags extended” (extKey: metatags). The output of the extension is added to the “page” object as “headerData.999” (extension default).
page.headerData.999 {
local >
local {description.data = register:newsSubheader
keywords.data = register:newsKeywords
}
}
Since tt_news only uses standard "typolink" functions to build its links, it works with “simulateStaticDocuments” and “RealUrl”.
A RealUrl configuration example is included. See file: EXT:tt_news/res/realUrl_example_setup.txt Copy the contents of this file to your /typo3conf/localconf.php. See comments in file for needed changes. The only thing which is needed change should be the id of the rootpage. For detailed information about the configuration of this extension see the “realUrl manual”.
tt_news offers several ways to optimize RealUrls that include tt_news parameters. By default all links to a news single view will contain all GETvars that are needed to build the “back to List”-link. In case a link points from a LIST showing an archive period to the SINGLE view its realUrl would look like this:
http://www.example.com/news/archive/period/1112313600/2681999/archived/article/newstitle/
Which means: [domain name]/[pagetitle]/[pagetitle]/[label for archive vars]/[period start in unixtime]/[period length in seconds]/[tx_ttnews[arc]]/[label for news title]/[title of the news record]
This shows two problems at once:
a) Something like “1112313600” can not be considered as “speaking Url”. For almost all humans it is not obvious that this means: April 1st 2005.
b) If the news article is shown in more than one list, there will be different SINGLE views with different backPid parameters. There will be multiple instances of the article in the page cache too, which will f.e. produce multiple search results for the same article in indexed search. RealUrl will detect these duplicates and will disable caching what will slow down the site.
Both problems can be solved by adding this to your TS setup:
plugin.tt_news {dontUseBackPid = 1
useHRDates = 1
}
“dontUseBackPid” will prevent the backPid and all other backPid-related parameters in links from tt_news. The disadvantage of this feature is, that now the backPids from all SINGLE views will point to the same page – the one that is configured as “plugin.tt_news.backPid”.
“useHRDates” will enable tt_news to use “year” and “month” instead of “pS”. “pL” and “arc”.
Now the URL from above should look like this:
http://www.example.com/news/article/newstitle/
With the monthnames and numbers as key-value pairs in the realUrl configuration, Urls with “speaking archive dates” are possible (see example realUrl configuration file). Links, pointing to archive periods would look like this:
http://www.example.com/news/2005/april/
With two additional parameters tt_news can be configured to add the values for “year”, “month” and even the “day” to the links pointing to the SINGLE view. “useHRDatesSingle” will enable the use of all three vars, “useHRDatesSingleWithoutDay” will add only “year” and “month” to this links.
Example:
plugin.tt_news {useHRDates = 1
useHRDatesSingle = 1
useHRDatesSingleWithoutDay = 1
}
The table shows with which configuration links would look how:
code | useHRDatesSingle | useHRDatesSingleWithoutDay |
|---|---|---|
LIST/LATEST | http://www.example.com/news/ | http://www.example.com/news/ |
AMENU | http://www.example.com/news/view/2005/04/ | http://www.example.com/news/view/2005/04/ |
SINGLE | http://www.example.com/news/view/2005/04/12/this-is-awesome/ | http://www.example.com/news/view/2005/04/this-is-awesome/ |
("view" is the name of the realUrl postVarSet for tt_news)
The table shows all views at the same page (news/). This is possible with a bit TypoScript which is explained in the section “TypoScript Examples” in this manual.
SimulateStaticDocuments
This feature is not so sophisticated as realUrl and therefore a bit easier to configure - you'll only have to add the lines below to your TS setup. With SimulateStaticDocuments the URLs of your site will look like this:
http://server.com/news/newstitle+M5aj89345.0.html
To get rid of the GET parameters from tt_news showing in the adressbar of your browser, you can add them to the pEnc_onlyP list (see example):
config {
simulateStaticDocuments=1
simulateStaticDocuments_pEnc=md5
# displays 22 chars of the page title
simulateStaticDocuments_addTitle=22
# include the GET parameters from tt_news to the encoded vars (all in one line)
simulateStaticDocuments_pEnc_onlyP = cHash, L, print, tx_ttnews[backPid],
tx_ttnews[tt_news], tx_ttnews[pS], tx_ttnews[pL], tx_ttnews[arc], tx_ttnews[cat],
tx_ttnews[pointer], tx_ttnews[swords]
}
More information: Tsref->CONFIG
The display of date and time values in the FrontEnd depends on the environment where TYPO3 is installed. tt_news uses the global language-settings from PHP and then it formats the date and time values with the stdWrap function "strftime". (see: http://www.php.net/manual/en/function.strftime.php )
The defaults for formating of the date and time strings are configured in the TS-setup of tt_news.
Notice: if you have one of the ts_language_xx extensions installed and configured as default language, these extension will override the default settings for the tt_news time formating. The language specific TS settings for several extensions can be found in the file "ext_typoscript_setup.txt" in the (ts_language-) extensions install directory (e.g. "typo3/ext/ts_language_de/ext_typoscript_setup.txt" for the german settings).
These settings are again overridden by settings you make in your main TS template or in some "+ext" templates located in pages below the main template. If you look in the "template analyzer" you see the loading order of the TS-settings. The values in the template at the end of the list will override previous settings):
To view or change the settings for a page, click on “Template” in the “Web” menu, choose this page in the pagetree, and open the “TypoScript Object Browser” on this page. (See screenshot at the beginning of the section “Configuration”).
Your site is a "one-language-site" and you configured the site-language as default language of TYPO3. If you have a ts_language_xx extension installed, to set some country specific settings for other extensions, I suggest to copy the part which refers to tt_news in your main template or an ext template which is included. Here an example for german settings:
# set the TYPO3 language to german
config.language = de
# set the PHP locale to german
config.locale_all = de_DE
# tt_news date & time formats
plugin.tt_news { archiveTitleCObject {10.strftime = %B - %Y
}
getRelatedCObject {20.strftime = %d.%m.%Y %H:%M
}
displaySingle {date_stdWrap.strftime= %d.%m.%y
time_stdWrap.strftime= %H:%M
}
displayLatest {date_stdWrap.strftime= %d.%m.%y
time_stdWrap.strftime= %H:%M
}
displayList {date_stdWrap.strftime= %A %d. %B %Y
time_stdWrap.strftime= %d.%m.%y %H:%M
}
}
Hint: If the locale_all setting "de_DE" don't work on your WAMP installation, try to set it to "german". There are some differences in the handling of the php-locale on windows and linux.
If your site is a multilanguage site like the "one-tree-fits-all-languages" example from the "testsite" package (see: http://typo3.org/documentation/tips-tricks/multi-language-sites-in-typo3/ ) you can add the country specific settings to the language condition in your TS-setup:
# Setting up the language variable "L" to be passed along with links
config.linkVars = L
# German language, sys_language.uid = 2
[globalVar = GP:L = 2]
config.sys_language_uid = 2
config.language = de
config.locale_all = de_DE
# set german date & time formats
plugin.tt_news { archiveTitleCObject {10.strftime = %B - %Y
}
getRelatedCObject {20.strftime = %d.%m.%Y %H:%M
}
displaySingle {date_stdWrap.strftime= %d.%m.%y
time_stdWrap.strftime= %H:%M
age_stdWrap.age = Minuten | Stunden | Tage | Jahre
}
displayLatest {date_stdWrap.strftime= %d.%m.%y
time_stdWrap.strftime= %H:%M
}
displayList {date_stdWrap.strftime= %A %d. %B %Y
time_stdWrap.strftime= %d.%m.%y %H:%M
}
}
[global]
# Danish language, sys_language.uid = 1
[globalVar = GP:L = 1]
config.sys_language_uid = 1
config.language = dk
config.locale_all = danish
# set danish date & time formats
plugin.tt_news {# sorry, don't know the danish date & time settings ;-)
}
[global]
Since version 2.0.0 tt_news supports the localization features introduced with TYPO3 3.7.0. Now you can build a true “one-tree-fits-all-languages” site without breaking this concept by using a news-sysfolder for each language.
Note: If you use TYPO3 3.6.2, tt_news will work as known, because the localization features will be disabled if no TYPO3 3.7.0 or higher is found.
To integrate tt_news in a multilanguage site, follow the steps described below.
Environment for this example: a working multilanguage site for normal content with tt_news 2.0.0 installed and some news articles.
Open the sysfolder where your news are located (in web/list view) and create an “Alternative Page Language” for each desired translation.
Now activate the “localization view”:
If you assigned flag-images to your website languages you should see something like this in your browser:
Click on a flag icon (or the language label) to “localize” a news db-record in a certain language. Now the flag-icon is moved to the “localization” column to show that this news record is translated.
Hint: If you don't want the localized news records to be immediately visible on the website you can enable “Hide new translations” in the extension configuration (see section “Installation”).
The titles of the news records had been prepended with “[Translate to {language_label}]”.
Hint: Prepending titles with “[Translate to {language_label}]” can be disabled in the extension configuration. If this is disabled “(copy [#])” will be added to the titles of localized records. This can be disabled, too by setting “Prepend at copy” to” 0” (see “Localization mode for text fields” and “Prepend at Copy” in section “Installation”).
Language = all
if you set the language in a news record to “all” ths record will be displayed in all available languages.
Now let's see what else changed in a “localized” news article:
You see, that some fields are “missing” in the translated version. Those fields are taken from to the original-language (f.e.: type, related news). Categories are always copied from the record in the default language. The localized article shows only which categories are assigned they are not editable in translations. If the record has categories assigned that are not in the list of allowsed categories for the current BE user a warning message will be displayed and saving of the article will be disabled (see section “Categories” for more information).
Hint: The image field of a localized news article is excluded by default (images are alwas taken from the record in the default language). If you need localized images (f.e. if the images show texts) you can enable the "image" field for translated news by setting "l10n_mode_imageExclude" to “0” in the extension configuration.
All fields are showing the value of their original-language below the input field.
With the TS-var “sys_language_mode”, you can configure the handling of not translated news-articles. The default is to display the article in the default language if there is no translation was found. If you don't want this behaviour you can set “sys_language_mode” to strict
plugin.tt_news.sys_language_mode = strict
Let's say you have 10 news articles in your site (in the default language) and 5 of them are translated to the selected language. In the default “sys_language_mode” a news list will display 10 items. With “sys_language_mode=strict” the same list will show only 5 news articles.
The example language-menu (/media/scripts/example_languageMenu.php) coming with older TYPO3 packages (“testsite” package) does not support the tt_news GETvars (the parameters in the Adressbar). The HMENU type=language (new in TYPO3 3.7.0) does exactly the same.
I included a new version of this script in the tt_news distribution. See file: EXT:tt_news/res/tt_news_languageMenu.phpThis version keeps the link vars from tt_news (and other extensions) and it also works with simulateStaticDocuments and RealUrl.
You can also use the extension: “sr_language_menu” to switch your website's languages. This extension keeps also the linkVars from tt_news.
To enable your site for serving news as XML-feed, add the static ext-template “News-feed (RSS 0.91, RSS 2 , RDF, Atom 0.3, Atom 1.0)” to your TypoScript setup. This adds a new page-type (100) and configures tt_news with the code “XML”, if a page with type=100 is requested.
the other settings for XML feeds can be configured in the constant editor or directly in your TypoScript setup.
Here's a comparison chart of the required (r), optional (o) and not available (n/a) settings for the different feed formats:
rss091 | rss2 | rdf | atom03 | atom1 | |
xmlTitle | r | r | r | r | r |
xmlLink | r | r | r | r | o |
xmlDesc | r | r | r | o | o |
xmlLang | r | o | n/a | o (recommended) | n/a |
xmlIcon | r | o | o (must be 88x31px) | n/a | n/a |
If you want to include the settings by TS – Here's the code:
# Configure tt_news to display the xml template
plugin.tt_news { displayXML {# rss091_tmplFile = EXT:tt_news/res/rss_0_91.tmpl
# rdf_tmplFile = EXT:tt_news/res/rdf.tmpl
# atom03_tmplFile = EXT:tt_news/res/atom_0_3.tmpl
# atom1_tmplFile = EXT:tt_news/res/atom_1_0.tmpl
rss2_tmplFile = EXT:tt_news/res/rss_2.tmpl
# possibile values: rss091 / rss2 / rdf / atom03 / atom1
xmlFormat = rss2
xmlTitle = example.com: Latest News
xmlLink = http://example.com/
xmlDesc = Latest News
xmlLang = en
xmlIcon = fileadmin/tt_news_article.gif
title_stdWrap.htmlSpecialChars = 1
title_stdWrap.htmlSpecialChars.preserveEntities = 1
subheader_stdWrap.stripHtml = 1
subheader_stdWrap.htmlSpecialChars = 1
subheader_stdWrap.htmlSpecialChars.preserveEntities = 1
subheader_stdWrap.crop = 100 | ... | 1
subheader_stdWrap.ifEmpty.field = bodytext
xmlLastBuildDate = 1
}
}
## This enables the xml news feed
xmlnews = PAGE
xmlnews {typeNum = 100
10 >
10 < plugin.tt_news
10.pid_list >
10.pid_list = {$plugin.tt_news.pid_list} 10.singlePid = {$plugin.tt_news.singlePid}10.defaultCode = XML
config {disableAllHeaderCode = 1
additionalHeaders = Content-type:text/xml
no_cache = 1
xhtml_cleaning = 0
}
}
## To get an additional RDF feed add the followingrdffeed = PAGErdffeed < xmlnewsrdffeed { 10.displayXML.xmlFormat = rdf 10.displayXML.xmlIcon = fileadmin/feed_icon_88x31.gif typeNum = 101}## To get an additional Atom 0.3 feed add the followingatom03feed = PAGEatom03feed < xmlnewsatom03feed { 10.displayXML.xmlFormat = atom03 typeNum = 102}
## To get an additional Atom 1.0 feed add the followingatom1feed = PAGEatom1feed < xmlnewsatom1feed { 10.displayXML.xmlFormat = atom1 typeNum = 103}
Hint: if you add the line below to the header of your site, browsers will detect this site as a RSS-source. (f.e. Firefox 1 with the nice “Add life bookmarks” feature)
<link rel="alternate" type="application/rss+xml" title="RSS-Feed"
href="http://my-server.org/index.php?id=5&type=100">
More information:
RSS 0.91 specification: http://my.netscape.com/publish/formats/rss-spec-0.91.html
RSS 2.0 specification: http://blogs.law.harvard.edu/tech/rss
RDF specification: http://web.resource.org/rss/1.0/spec / http://www.w3.org/TR/rdf-syntax-grammar/
Atom 0.3 specification: http://www.atomenabled.org/developers/syndication/atom-format-spec.php
Atom 1.0 specification: http://www.atomenabled.org/developers/syndication/