tt_news
1.3.4. The tt_news content element
There are many ways to configure this extension. This will just get you started. For detailed configuration options take a look at the parts "Administration" and "Configuration" in this manual.
There are currently 4 option-sheets in the tt_news content element ("General Settings", "Template", "Category Settings" and "other settings"). First we will concentrate on General Settings because all of the required options are located in this sheet.
Notice: Most of these options can also be controlled by TS, but the settings made directly in the content element will override TS settings.
Sheet: General Settings
What to display:
Currently there are 7 different options in the "What to display" field (this list can be extended by other extensions). These are the function of this options:
|
FIELD: What to display |
Description: |
|---|---|
|
LIST |
Displays a list of news. |
|
LATEST |
List the latest news. By default this is not just another "LIST" template. It lists only non-archived new-records, and it is not influenced by the archive menu selection. (This behaviour can be changed by setting "displayArchivedInLatest" to 1 -> then LATEST will act like a normal LIST) |
|
AMENU |
Displays a menu of the archive divided into time periods. See section "The Archive". |
|
SINGLE |
Displays a single news item. See section "The SINGLE view". |
|
SEARCH |
Displays a search box and result listing for searching news. See section "The Search". |
|
CATMENU |
Displays a category selector which shows nested categories in a hierarchical menu. See section "The category selector". |
|
VERSION_PREVIEW |
Displays the version preview for news articles. Basically it does the same as the SINGLE view but it displays only something when a version preview was requested.This option appears only when the extension "version" is installed. see section "version preview" for mor information. |
It is possible to define multiple "What to display"-codes in a news content-element, but some of them will not work well together. If you encounter problems with those combined content-elements, try to split them in single elements with one code per element.
"Order by" this field (LIST & LATEST):
In this selectbox you can choose the field by which the listed news-records should be ordered. Possible options are: datetime, archivedate, author, title, type and "randomise order".
default (= nothing selected) is to order lists by the "datetime" field and display newest items first.
With the selectbox "Ascending or Descending" you can choose the sorting order.
If you want to order or group your news by fields, not listed here, you can do this by setting those fields by TypoScript. See section "Reference" -> "listOrderBy" and "listGroupBy"
The special case "randomise order" orders the news by random.
Hint:
If you use randomly ordered news, it is required that tt_news works as USER_INT object or caching disabled.
Add this to the TS setup of the page where you want to display rendom news:
plugin.tt_news = USER_INT
f this page is on the first level of the pagetree all pages below this page will also display tt_news as USER_INT object which consumes much more processing power than a USER object which can be cached.
This can be prevented by using the 'template on next level' feature to set tt_news again to USER.
plugin.tt_news = USER
Category selection:
The display of categories in the right field of the part "Category Selection" depends on two settings:
If you didn't change the default value of the "use StoragePid" switch in the plugin-configuration in the extension manager, it is required to define a "General Record Storage page" in the page-properties of the rootpage (the page with the "is root of the website" flag).

The "General Record Storage page" points to the folder where the tt_news categories are stored. See "FAQ" for more information.
If you set the "use StoragePid" value to "0" in the extension manager, you should see all categories from the whole pagetree in the select box.
It's possible to select newsitems for display by their assigned categories or subcategories. A newsitem can be member of multiple categories. It's also possible to de-select news by their assigned categories of to display only non-categorized items. The "Category mode" selector offers the following options:
|
FIELD: Category mode |
Description: |
|---|---|
|
Show all (don't care about selection below) |
Displays all news no matter which categories are assigned. (Don't care about the field: Category selection) |
|
Show items with selected categories (OR) |
Only news are displayed, which have at least one of the selected categories or subcategories assigned (FIELD: Category selection). If there are more than the selected categories assigned to the news record it will be shown also. |
|
Show items with selected categories (AND) |
Only news are displayed, which have all of the selected categories or subcategories assigned (FIELD: Category selection) |
|
Do NOT show items with selected categories (AND) |
News which are members of all of the selected categories or subcategories (FIELD: Category selection) will not be displayed. |
|
Do NOT show items with selected categories (OR) |
News which are members of at least one of the selected categories or subcategories (FIELD: Category selection) will not be displayed. |
Use subcategories
With this switch you can configure if news items are also selected by their subcategories.
Archive setting (for LIST):
It is possible to give each news record an "archive date". It is also possible to handle news-items automatically as archived, if they are older than a certain number of days. -> see: Section "The Archive" and the part "Archive Settings" in section "Reference".
("for LIST" means, that the archive mode is only selectable for the "LIST" view. "LATEST" is by default never showing archived items -> can be changed with "displayArchivedInLatest")
"Archive setting" gives you these options:
|
FIELD: Archive setting |
Description: |
|---|---|
|
Don't Care |
Show all newsi no matter if they are archived or not. |
|
SHOW ARCHIVED |
Show only news which have reached their archive date |
|
SHOW NONARCHIVED |
Show only news which have not reached their archive date. |
Starting point and Recursive level selection:
"Starting point" is used to tell the extension where the news records are stored. It is possible to select multiple "Starting points". This way, you are able to collect news from several folders to display them in one content-element.
If you don't insert a page as "Starting point", tt_news will look for a value for "pid_list" from TypoScript. This is the recommended way to configure many news content-elements from one central point, e.g. from the constants field in your main TS-template. -> see files EXT:tt_news/static/ts_new/constants.txt & EXT:tt_news/static/ts_new/setup.txt for examples. The "Starting Point" can also be set in the Constant editor.
If no value for "Starting Point" is present at all, the current page is used. (the page where you inserted the tt_news content-element).
Recursive level selection:
This tells the extension how many levels of subpages to include below the page(s) given in the "Starting point" field.
Hint
If you have your news not stored in a few dedicated sysfolders but scattered around in a huge pagetree it might be helpful to disable the pid_list/recursive functionality completely (see: "dontUsePidList"). Reason: TYPO3 checks each page in the pid_list for visibility and if the current FE user is allowed to see this page. When you have a very long pid_list which is generated from a whole pagetree this will take quite a lot processing power.
Sheet: Template
In the sheet Template, you can overwrite the html-template defined globally by TypoScript with another one.
It is not required to define a template in this place, because in most cases several news content-elements under one pagetree use the same html-template. This can be defined directly in the TS-setup or in the Constant-Editor of your main-(TS)template.
Hint
The best way to include your own html-template is to link it directly in TS. Add the following line by hand to your TypoScript setup or edit the default value in the "TypoScript Object Browser":
plugin.tt_news.templateFile = fileadmin/templates/tt_news_template.html
Do not edit and save the html-template in the extension directory -> it will be overwritten if you update tt_news.
You can change the news display, by simply creating a new template-file for the display of news. There are 2 default template-files included in tt_news (in the folder EXT:tt_news/pi/):
-
tt_news_v2_template.html: the new css-based html-template.
-
news_template.tmpl: the table-based template.
The main differences between the new css based template and the "traditional" template are:
-
In the new template, the visual formating is moved from TypoScript to css-styles. GlobalWraps, GlobalColors and many of the Wraps (like "title_stdWrap") are not used anymore.
-
TypoScript still plays a big role in configuration for processing parts of the output (f.e.:"age_stdWrap") or for inserting all kinds of conditional wraps (see: "getRelatedCobj" for an example)
if you want to change the template, take a look at that file, make a copy of it and modify it to your own design. Observe the comments in the file - they are markers that define where content is inserted and which parts are used for this and that. Self explanatory to a certain degree...
Max Width/Height for images
These 2 fields offer you the possibility to set the image sizes for a certain content element different from the image sizes defined globally by TypoScript. The setting here will be applied to all images, displayed by this content element (works with: LIST, LATEST, SINGLE and SEARCH)
Sheet: Category settings
The sheet "Category settings" offers a range of options regarding how to display category-texts (titles) and category-images.
The default setting is "Use the settings from TS" which is "Display but no link" for images and texts.
|
FIELD: Category Image Link Mode, Category Text Link Mode |
Description:
|
|---|---|
|
Use the settings from TypoScript |
You can set the options for displaying category images and texts also by TS but this values are only recognized if this option is selected. See "catImageMode" and "catTextMode" in the Constant editor. |
|
Don't display at all |
No category images/texts will be displayed |
|
Display but no link |
Category images/texts will be displayed but not linked |
|
Act as link to category shortcut |
Category images/texts will be displayed and function as a link to the page given as category shortcut. |
|
Act as category selector |
Category images/texts will be displayed and function as category selector. -> useful for filtering search results |
Other Category settings:
|
FIELD: |
Description: |
|---|---|
|
Max width of category image |
Maximum width of category images. If one dimension of the image is larger than the given width or height, the image is downscaled. |
|
Max height of category image |
See above |
|
Max number of category images |
here you can limit the number of displayed category images |
|
Max number of categorys texts |
Same for category texts |
Sheet: Other settings
PageId for single news display:
This tells the extension on which page the single view is located. It's not required to set a value here, cause it's more efficient to set a global value for the single view (singlePid) in the constant-Editor of your root template. See: "Configuration"
PageId to Return to:
Here you can set an alternative page for the "back to list" link in the single view. Works of course only if the current content element is SINGLE. By default the "back to List" Link in the SINGLE view points to the page where you came from. The setting here will override a globally given "backPid".
Don't display first image in single view (firstImageIsPreview):
If you set this checkbox, the SINGLE view will not display the first image atached to the news article. The first image will only appear in LIST and LATEST view and is handled as "preview image" of the news item.
(works only if more than one image is atached to the news article).
You can force this behavior even when only one image is assigned to the news record by checking the next checkbox (forceFirstImageIsPreview)
List StartId: Force LIST or LATEST to start from this item [deprecated]
with this option (and "limit") you can realize complex combinations of news content-elements, by giving each item its own offset from the first result.
Example:
Let's assume you want to realize a page that looks like this:

the first (red) content element is configured to show one item (limit=1). The "listStartId" is empty, so it shows only the very first result.
the second (purple) content-element shows also only one item (limit=1) the "listStartId" is set to 1 (because the counting starts with zero). The image in this content element is set to a smaller size than the first content-element.
the two other content-elements (green) are both limited to show 4 items, the left one starts with "listStartId" set to 2, the other one starts with listStartId=6
(thank goes to Paolo Nugnes for sponsoring this feature)
Hint
Since tt_news 2.5.0 "listStartId" is deprecated because the new TS option "excludeAlreadyDisplayedNews" does the same without the need to configure the listStartId for each content element. If you f.i. Want to get a news layout like shown in the image above simply place 4 news plugin content elements on the page, configure the limit for each plugin and add the following line to your TS setup:
plugin.tt_news.excludeAlreadyDisplayedNews = 1
If "excludeAlreadyDisplayedNews" is enabled "excludeLatestFromList" and "listStartId" will be ignored.
Limit: max items in LIST and LATEST
here you can set a limit only for this content-element. A value from this field will override the limits configured by TypoScript.
Don't display Pagebrowser
as the name says.
Insert pagebreak in SINGLE after this number of words
If you want to override the globally configured value for "maxWordsInSingleVIew" in the current content-element, you can insert the new value here. For more information see section "Pagebreaks" in this manual.