DEPRECATION WARNING
This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.
EXT: news¶
Created: | 2006-04-05T09:44:51 |
---|---|
Changed by: | Rupert Germann |
Changed: | 2009-11-27T13:54:30 |
Email: | rupi@gmx.li |
Info 2: | |
Info 3: | |
Info 4: |
EXT: news¶
Extension Key: tt_news
Copyright 2000-2009,Rupert Germann, <rupi@gmx.li>,
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.com
Table of Contents¶
EXT: news 1
Introduction 1
What does it do? 1
NOTE: This manual does not contain all new features an changes from tt_news 3.0. See document “tt_news_3.0_changes.sxw” in the extensions doc/ folder for a more detailed description of the changes in tt_news 3.0 1
Screenshots 3
Users manual 7
How to update: 7
Installation 10
Quick start: 12
The tt_news content element 15
The tt_news database-record 19
Categories 21
The tt_news_cat database-record 24
The category menu (CATMENU) 25
The SINGLE view 27
The Archive 28
The Search 29
Version Preview 30
Troubleshooting 30
Administration 32
Link Configuration 32
User Tsconfig 34
Page TSconfig 35
The Rich-Text-Editor 35
Rights & Permissions 37
Caching 37
Configuration 39
Files: 39
Reference 41
TypoScript Examples: 60
Registers 62
RealUrl and SimulateStaticDocuments 63
Date and Time formats 65
Multilanguage News 66
XML feeds from tt_news 69
Extending tt_news 72
List of tt_news add-ons 72
Sponsoring tt_news development 73
Known problems 73
To-Do 73
Changelog 73
Introduction¶
What does it do?¶
NOTE: This manual does not contain all new features an changes from tt_news 3.0. See document “tt_news_3.0_changes.sxw” in the extensions doc/ folder for a more detailed description of the changes in tt_news 3.0
Extension for displaying and managing news.
Features:
- 3 types of news items: standard news articles, external links and links, pointing to internal pages.
- Full multilanguage support
- News-articles can be related to each other and/or to internal pages. If two news articles are related, the link back to the source article is inserted automatically.
- The view of the complete news article (single view) can be splitted to multiple pages. Pagebreaks can be inserted manually by a userdefined “pagebreak token” or after a certain amount of words.
- All types of mediafiles can be assigned to news-articles.
- Very flexible news content-element with the following functions: several List views, Latest, Archive-menu, 2 different Single-views, Search, a menu from nested categories (CATMENU) and a special kind of single view: the “version preview”.
- The appearance of the news plugin on the website can easily be changed by editing the html-template.
- 2 different html templates included: A table-based template which is kown from older tt_news versions and a new CSS-based template (see screenshots below).
- News-categories, that can be assigned to news (multiple selections possible). Categories can also be nested to each other. News can be selected (or de-selected) for display by their categories or parent- categories.
- All category trees in BackEnd forms can be expanded and collapsed. If you have a huge category tree this will speed up the rendering of the tree significantly.
- Category-images and category-titles can act as link to a specific page or function as category-selector.
- The Single view of an article can show a list of news, having the same categories assigned as the current article.
- In the BackEnd categories can be used to configure the editing permissions for news records. A list of allowed categories can be configured for a BackEnd usergroup. If a member of this group tries to edit a news record that does have at least one category assigned that is not in this list saving of the record will be disabled.
- Internal search function with configurable “search fields” (can be combined with the category-selector function to filter results by categories).
- “Editlock”: By activating the checkbox “Restrict editing by non- Admins” a news record can be locked for editing by non-admin users.
- “Automatic archiving”: After a given number of days has passed, news are automatically in the archive, no need to set an archivedate manually for each item.
- Supports caching and Indexing: If caching is enabled news-articles are indexed by the extension “indexed search”.
- Supports “direct preview”: When the “save & view” button in a news record (in the BackEnd) has been pressed the “single view” of this record will be opened on the website. (see section “Page TSconfig”)
- Several possibilities to add user-defined scripts to process the output of the extension f.e. to add your own markers and templateparts. (-> see sections “Configuration/files” and “Extending tt_news” for some examples)
- Supports export to the following XML-feed formats: RSS 0.91, RSS 2, RDF Atom 0.3 and Atom 1.0.
- Supports versioning and workspaces. “Versioning preview” is supported with a special mode of the tt_news content element (VERSION_PREVIEW) which will be available if the extension “version” is installed.
- “Context sensitive help” (CSH) for all fields in the tt_news and tt_news_cat BackEnd forms.
New in tt_news 3.0¶
- New backEnd module to manage news records and categories: “news admin”
- FE plugin changes:- OptionSplit for many parameters (even in flexform)- New Display modes (CODEs) and template parts- Build-in processing of generic markers (thanks to Ringer Gerorg ;-) )
- Easy update: new updater script which fixes the most common migration problems
- Serious speed improvements: internal caching of processing intensive values
- Improved usability: reorganized constant editor options, plugin flexform and news record form.
See document “tt_news_3.0_changes.sxw” in the extensions doc/ folder for a more detailed description of the changes in tt_news 3.0
Compatibility¶
This version of tt_rews requires at least TYPO3 4.1.0 to run, some features require TYPO 4.2 or 4.3 (which is recommanded to use).
WARNING !! Do not install this tt_news version on TYPO3 prior to version 4.1.0 because it requires features that are not present in older TYPO3 versions. Don't even try it, because it might break your TYPO3 installation!
PHP version: tt_news should work on all PHP versions that are also supported by TYPO3 (from 5.2.x to 5.3.0).
MySQL version: 5.x.
Screenshots¶
List View & Archive-menu: News extension in a two column design, showing the Archive-menu (AMENU) in the left column and the “LIST” view in the normal column.
Latest news:
Search-Form:
Single View: For news with type “normal news” the single view shows the full article with related news, links and - not in this image - attached files and “related news by category”.
The category menu (CATMENU) The catmenu offers 3 different render modes.The left image shows the catmenu in mode “nestedWraps”, the middle and rightcatmenu are working in mode “tree” or “ajaxtree”. The right one uses userdefined icons (See section “The category menu”)
News Database record in BackEnd: The editing form is divided in sections (Tabs) grouping fields by their purpose. Here you see all possible fields, including the secondary options. Of course it is possible to hide some fields. So the editors see only e.g. “datetime”, "title" and "bodytext".
Tab “Relations” in the tt_news database record The field “related news” supports the new “suggest” wizard from TYPO3 4.3
The “news-admin” Backend module Since version 3.0 tt_news comes with a BackEnd module for managing news and news categories.
Users manual¶
How to update:¶
Did you really make a backup of your site? If yes, then go ahead and update tt_news with the extension manager. The first screen you'll see will look like this:
Note the unobtrusive “Updater Box” in the upper right corner. This box offers a direct link to the new updater script.
But first update all required database tables.
Then open the updater. Only opening the updater does not change anything in your installation, the script only reads data from the database and from the filesystem to check for setting that should be changed.
The updater screen starts with a warning message that you should read at first:
The boxes below the warning message inform you about what checks have been done and what the results are.
The following checks are executed:
- Search for outdated static TS templates
- Search for non existing HTML templates
- Search "Startingpoint" ("pages") in FF (flexform settings)
- Search "recursive" in FF
- Search "no page Browser" in FF
- Search "listLimit" in FF
If you see only green checkmarks and “Nothing to do” messages you can stop here and quit the updater (this happens f.e. on a fresh install).
In case the updater has found something that needs to be fixed you'll see yellow exclamation marks and “DO IT” buttons.
Let's have a closer look on the “Search for outdated static TS templates” function. This function searches the database for template records (table: sys_template) with outdated references to the static TS templates from tt_news. The references to static extension templates in field “Include static (from extensions)” are stored with the path and since I moved the folder for the static templates to pi/static/ the old paths will not fit anymore. To fix those references you could edit all your TS templates, but since there could be quite a lot of these template records (depending on your sites configuration) I thought it'd be a good idea to let a script do this work. If you also think like this, click on the “DO IT” button.
The next screen tells you what the updater did:
Attention: this information is only shown once. If you need it for later purpose copy it now.
Clicking the “back” link will bring you back to the main screen of the updater which should now show a changed “Search for outdated static TS templates” box:
The next function (“Search for non existing HTML templates”) works a bit different from the others because it does not replace a value by a new value – it clears the references to HTML-templates which do not exist in the filesystem from Flexforms in tt_news plugin elements (recommanded way is to set the html template in TS). The main reason for writing this function was to get rid of the old “tt_news_v2_template.html” which was inserted as default in tt_news 2.5.2. This template still existst in tt_news but I moved it to the res/ folder. If the updater finds content-elements with configured HTML templates that actually exist in the filesystem it will not touch this records.
If you click on “DO IT” you'll see which records the updater changed and which templates were missing.
Now go through the remaining updater functions until the main screen shows only green checkmarks.
Installation¶
Install the extension with the extension manager. If you already use an older version of tt_news that's installed in the “global” location (typo3/ext/), it's recommended to install the new extension in the “local” folder (typo3conf/ext/) without overwriting the old one. In case something fails you'll have thereby a possibility to re-establish the original installation state from where you started the update.
For further information about upgrading an existing tt_news installation to a newer one, see section “update howto”.
After the extension manager created the new database tables and fields for tt_news you should see a page with the main configuration options. Here you can configure some basic options (mostly BackEnd related).
Handling of Categories¶
Use "General record storage page"
You can configure the handling of news-categories with a checkbox in the extension manager:
The default is, to display categories only from the “General record storage page”. For more Information about categories and the “General record storage page” have a look at the “FAQ” in section “Quickstart”.
Require categories
Check if categories are required for every news item. Note that you can require categories also through page TSConfig using "TCEFORM.tt_news.category.config.minitems=1"
Caching¶
Internal caching
If enabled tt_news caches some processing intensive information (archive period count, category count, categories) in an internal cache.
Caching Mode
Determines the cache entries lifetime and when the internal cache from tt_news will be cleared. "normal": (default) the cache entries will get the same lifetime as normal pages. The tt_news cache will be cleared when the "clear all caches" button is pressed. "lifetime": will set the livetime of cache entries to the given amount of seconds in field "cacheLifetime". The cache table is not cleared when "clear all caches" is clicked. "static": means: the lifetime of cache entries is set to zero (= unlimited). TYPO3 does not clear the tt_news cache (useful if you clear the cache with an external script or for debugging).
Cache lifetime
Lifetime in seconds of the internal cache entries (if "cachingMode" is set to "lifetime"). example: 86400 (a day), 604800 (a week)
Caching engine
Where should the cache entries from tt_news be stored. "internal": store cache records directly in the database using internal methods. "cachingFramework" Requires at least TYPO3 4.3: store cache records in the TYPO3 caching framework (in the default configuration tt_news uses the DB backend of the caching framework).
Labels in List Module¶
You can configure which field is taken as label in the web/list module. Default is to display the title as label but you can change it f.e. to the date field (datetime) if you want to see the datetime as title.
The other options configure the alternative labels which will be shown if the title is empty. If the first alternative label is also empty, “Alternative label 2” will be displayed instead. If “Force alternative label” is activated the alternative labels will be shown always, even if the label field is not empty.
Example:
The author field is configured as “News label”, the title field is the “Alternative Label” and the datetime field is “Alternative Label 2”. Now the titles in lists will look like this:
Localization settings¶
Localization mode for text fields By default, all text fields (text, subheader, imagecaption ...) from a new localized news article will be prepended with "[translate to ...]". If this is not wanted you can disable it here.
Localization mode for images 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 in translated news by setting "l10n_mode_imageExclude" to 0.
Hide new localizations By default, all text fields (text, subheader, imagecaption ...) from a new localized news article will be prepended with "[translate to ...]". If this is not wanted you can disable it here. If "l10n_mode_prefixLangTitle" is disabled the text "(copy [#])" will be added to the titles of this records unless "prependAtCopy" is disabled (see "prependAtCopy").
Prepend at copy¶
Here you can disable adding of the text "(copy [#])" to titles of copied records.
Category form fields¶
Category ordering in BackEnd trees Here you can configure the the ordering of categories in the category tree in BackEnd forms.
Width of the left category field This field shows the selected categories in the tt_news db-record (or parent categories in the category db-record). If "categorySelectedWidth" is set to 0 (zero) the default width (=180px) will be taken.
Width of the right category field This field shows the category tree in the tt_news db-record (or in the category db-record). If "categoryTreeWidth" is set to 0 (zero) the default width will depend on the browser which displays the TYPO3 BackEnd. The default width for all browsers except IE is 280px, for IE the default width is 320px to suppress the unneeded horizontal scrollbar below the category tree.
Debugging¶
Debug caching info
Which information about internal caching should be written to devlog (extension "devlog" required)."disabled": don't write any information about caching to devlog. "cache misses": log only cache misses. "all": log cache misses and cache hits to devlog.
Debug parsetimes
Write parsetimes to devlog (extension "devlog" required).
Parsetime threshold
Execution time in seconds after which a function is logged to devlog. Default is 0.1 sec = 100ms. Means any function in tt_news which needs more time to be executed will be logged. The execution time indicates the severity of the log entry: 0-0.2 sec = 0 (info), 0.2-0.5 sec = 1 (notice), 0.5-1 sec = 2 (warning) and everything above 1 second get severerity 3 = error.
Quick start:¶
This section will give you a short overview about the basic setup requirements for tt_news to work. For more detailed informations you can have a look in the sections “Configuration” and “Administration” in this manual.
Include static extension templates¶
The TS-settings are splitted in 3 different parts which should be included with the “Include static (from extensions)” feature.
For the first test, open your main TS-template (in list view), scroll down to the “Include static (from extensions)”-sectionand include one of the “base” templates from tt_news, f.e. the “table-based tmpl”. If you dont't know how to do this -> see section “Templates” in the “Getting Started” document: http://typo3.org/documentation/document- library/tutorials/doc_tut_quickstart/0.1.0/view/1/9/
If you want to use the CSS-based HTML-template you you should include the “default CSS-styles” template too, because it contains all the formating information.
The 4 static ext-templates offer you the following settings:
CSS-based tmpl: includes all tt_news TS settings for the new css- based template (but no ccs default styles)
default CSS-styles: This are the CSS-style definitions for the CSS- based template.
News-feed (RSS 0.91, RSS 2 , RDF, Atom 0.3, Atom 1.0): Include these settings if you want to enable XML feeds from your page.
Save your TS-template and open or create a page, where you want the news to appear.
Creating a “news” content-element:¶
Click on the "create new record" link, to add a new content-element. In the next screen click on the wizard link under “Pagecontent”.
The page that now openingis called the “new Content Element Wizard”. At the bottom of this page you'll find an icon called “News”':
Select it and choose the position (column): eg NORMAL:
A form will show up looking almost like this:
It is required, to select at least one item from the "What to display" field. If you don't do this, an error message will appear instead of the news content-element. To select an item, click on its name in the right list. (For the first test choose “LIST” or “LATEST” and leave the other settings at their defaults)
The “Startingpoint” is the page/sysfolder, where the extension looks for news-records. It is not required to set this value in this field, you can also define it with TypoScript for the whole page.See: section “Configuration/Reference” in this manual (-> pid_list)
If you don't insert a page as “Startingpoint” and no value for “pid_list” is defined by TS, the current page is used. That means the news-extension looks for news-records in the same page where the content-element is.
Creating a news database record:¶
To test the functionality of the extension you'll also need at least one news-record. Save & Close the form for the News content-element and click again on the "create new record" link.Choose the "News" item from the list.
A form opens, showing a news database record:
Fill in some dummy information, uncheck the "Hide" checkbox and save & close the form.
Assuming that you did not set a "Startingpoint" in the news content- element, and that the newly created news-record is located in the same page as the news content-element - click on the preview icon and you should see your news article in your browser.
If this is not the case, repeat the steps above. If still no news appear on your website, have a look in the section "Troubleshooting" of this document.
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:
LIST¶
FIELD What to display
LIST
Description
Displays a list of news.
LIST2¶
FIELD What to display
LIST2
Description
Advanced list view with 6 alternating template parts.
LIST3¶
FIELD What to display
LIST3
Description
Standard list view with 3 alternating template parts
HEADER_LIST¶
FIELD What to display
HEADER_LIST
Description
A minimalistic list view showing only the header and the date of news records
((Unknown Property))¶
FIELD What to display
Description
LATEST¶
FIELD What to display
LATEST
Description
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)
SINGLE¶
FIELD What to display
SINGLE
Description
Displays a single news item. See section “The SINGLE view”.
SINGLE2¶
FIELD What to display
SINGLE2
Description
Advanced detail view with 3 image markers.
SEARCH¶
FIELD What to display
SEARCH
Description
Displays a search box and result listing for searching news. See section “The Search”.
VERSION_PREVIEW¶
FIELD What to display
VERSION_PREVIEW
Description
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.
"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:
Show all (don't care about selection below)¶
FIELD Category mode
Show all (don't care about selection below)
Description
Displays all news no matter which categories are assigned. (Don't care about the field: Category selection)
Show items with selected categories (OR)¶
FIELD Category mode
Show items with selected categories (OR)
Description
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)¶
FIELD Category mode
Show items with selected categories (AND)
Description
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)¶
FIELD Category mode
Do NOT show items with selected categories (AND)
Description
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)¶
FIELD Category mode
Do NOT show items with selected categories (OR)
Description
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:
Don't Care¶
FIELD Archive setting
Don't Care
Description
Show all newsi no matter if they are archived or not.
SHOW ARCHIVED¶
FIELD Archive setting
SHOW ARCHIVED
Description
Show only news which have reached their archive date
SHOW NONARCHIVED¶
FIELD Archive setting
SHOW NONARCHIVED
Description
Show only news which have not reached their archive date.
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_v3_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,¶
FIELD Category Image Link Mode,Category Text Link Mode
FIELD: Category Image Link Mode,
Category Text Link Mode
Description
Description:
Use the settings from TypoScript¶
FIELD Category Image Link Mode,Category Text Link Mode
Use the settings from TypoScript
Description
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¶
FIELD Category Image Link Mode,Category Text Link Mode
Don't display at all
Description
No category images/texts will be displayed
Display but no link¶
FIELD Category Image Link Mode,Category Text Link Mode
Display but no link
Description
Category images/texts will be displayed but not linked
Act as link to category shortcut¶
FIELD Category Image Link Mode,Category Text Link Mode
Act as link to category shortcut
Description
Category images/texts will be displayed and function as a link to the page given as category shortcut.
Act as category selector¶
FIELD Category Image Link Mode,Category Text Link Mode
Act as category selector
Description
Category images/texts will be displayed and functionas category selector.
-> useful for filtering search results
Other Category settings:
Max width of category image¶
FIELD
Max width of category image
Description
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¶
FIELD
Max height of category image
Description
See above
Max number of category images¶
FIELD
Max number of category images
Description
here you can limit the number of displayed category images
Max number of categorys texts¶
FIELD
Max number of categorys texts
Description
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)
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.
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.
Typoscript for this content element
The tab “Other Settings” offers a new field “Typoscript for this content element (plugin.tt_news.[your TS])”. Since access to TypoScript for non-admin users is a security risk, this field is only visible for admin users. The Typoscript in this field is merged with the existing TypoScript setup for “plugin.tt_news”. If you f.i. want to add a wrap to the output of a single plugin simply write this to the TypoScript field:
stdWrap.wrap = <div class”myclass”> | </div>
The tt_news database-record¶
Field descriptions:
Title¶
The value inserted here will subsitute the marker ###NEWS_TITLE### in the html template.
Type¶
Here you can define the type of the newsitem. The different types are shown with different icons in the BackEnd. Possible types are:
¶
a
b
News
c
This type is used for normal news articles. Only these news will have a link to a single view.
¶
a
b
Link External page
c
These news records are only showing in list views (= LIST and LATEST). The links from these news records will point directly to the URL which is configured in the field “External URL”.
¶
a
b
L ink internal page
c
These news records are also showing only in list views. The target for these links is configured globally in the Constant editor (advanced->target for internal links)
Restrict editing by non-Admins¶
If this “editlock” is enabled non-admin users can't open this record. All other actions (hide,copy,delete,....) are also disabled.
Hide, Start, Stop and Access¶
With the fields “Hide”, “Start”, “Stop” and “Access” you can configure the visibility of the current newsitem. The settings made here will override visibility settings from categories that are assigned to this news record.
Date/Time¶
The value of this field affects several things:
- The news in lists andin the archivemenu (amenu) are ordered by this field if no other filed is selected (-> see "Order by" this field in section “The tt_news content element”)
- If a value for “datetimeDaysToArchive”, “datetimeHoursToArchive” or “datetimeMinutesToArchive” is set, these value is added to the value of the datetime field and handled as archivedate. (see section “The archive” in this manual)
- The value of these field is taken for the html-template markers ###NEWS_DATE###, ###NEWS_TIME### and ###NEWS_AGE###. (all parsed through the stdWrap functions “strftime” or “age”)
For new created records the current time is inserted atomatically.
Archivedate¶
If archivedate shows a value in the past, the news record will be shown in lists showing only archived news. Of course it will disappear from lists showing only non-archived news.
Transl.Orig¶
This field appears only in translated news records and points to the translation Original. (The translation original has to be in the default language)
Language¶
This field shows the language of the newsitem. This field should be not edited by hand because its value is handled by the translation system of TYPO3.
Author and Email¶
The values of this fields will substitute the html-template markers ###NEWS_AUTHOR### and ###NEWS_EMAIL###. By default only the author will be displayed and linked to the author's email address.
Hint:
If you need an author field which is a relation to another table where the authors are stored (f.e. fe_users), install the extension “News author relations” (extkey: news_author_rel) http://typo3.org/extensions/repository//news_author_rel/ which extends tt_news by this feature.
Versioning Label:¶
The versioning label of this record. This field is only visible when the extension "versioning" (extkey version) is installed.
Subheader¶
The value of this field will substitute the html-template marker ###NEWS_SUBHEADER###. If this field is empty the value of the field “Text” is taken instead.
Text¶
This is the main text of the news article and will substite the html- template marker ###NEWS_CONTENT###.
No automatic pagebreaks for this record¶
this will disable automatic pagebreaks after a certain amount of words for this record.
Keywords¶
The content of this field is written to a TypoScript register ("newsKeywords") which can be used to insert the keywords as "<meta> keywords" to the page header (plugin "metatags" required). If you don't need this field for "<meta> keywords" you can use it as a second "subheader" field (it will substitute the template marker ###NEWS_KEYWORDS###).
Category¶
Here you can assign categories to the current news record (if this record is no translation of another record).The available categories will be displayed in a tree. The titles of the assigned categories will substite the html-template marker ###NEWS_CATEGORY###, the category images will be written to the marker ###NEWS_CATEGORY_IMAGE###. Tt's possible to control editing permissons of news articles with the assigned categories. See section “Categories” for more information.
Images¶
Here you can define images that will be shown in the news item. All images will be rendered to the marker ###NEWS_IMAGE###.
Image altText and Image titleText¶
In these fields you can define two texts that will be inserted as alt and title texts in the image html tag. If more than one image is assigned the values of these fields can be splitted by linebreaks.
Links¶
The links that are inserted here will be displayed under the "bodytext" in the news single view. They will substite the marker ###NEWS_LINKS###. This field is parsed through the stdWrap function "parseFunc" so it will be possible to enter links as typolink. F.e.: <LINK http://typo3.org _blank>open typo3.org</LINK>
Files¶
Here you can attach files to a newsitem. Files will substite the marker ###FILE_LINK###.
Categories¶
You can assign categories to news. That allows you to display f.e. only news with a certain category in a “LIST” content-element.
Categories can have parent categories. The category “FrontEnd plugins” in the screenshot below does have category “Extensions” selected as “parent category”, so “FrontEnd plugins” is a subcategory of “Extensions”. If the use of subcategories for the FrontEnd is enabled the result is, that the news record with category “FrontEnd plugins” from the screenshot will also appear in a LIST that shows only the category “Extensions”.
The use of subcategories in the FrontEnd of the website has to be enabled by setting “useSubCategories=1” in the constant editor or directly in TS setup. The display of subcategories can be configured seperatly with the TS var “displaySubCategories”. Subcategories can be wrapped with another wrap than normal categories.
Example: This configures tt_news to use and display subcategories. Only news with the selected categories (23,34) will be displayed. Subcategories will be wrapped with a red border.
plugin.tt_news {
useSubCategories = 1
displaySubCategories = 1
categoryMode = 1
categorySelection = 23,34
displayList {
subCategoryImgItem_stdWrap.wrap = <span style="border:1px solid red;">|</span>
subCategoryTitleItem_stdWrap.wrap = <span style="border:1px solid red;">|</span>
}
}
In the BackEnd the categories are shown in a tree view. Since tt_news 2.5.0 the category tree is expandable and collapsible.
Categories can be created with the “create new record” link like shown in the section “Quickstart”, or with the “+”(add) icon directly from the news db record.
Hint: Editing of categories directly from a news record works only for categories which are assigned to this record record. To edit a category select it in the left category field and click on the edit button (the pencil).
The page where new categories from the “add” wizard will be created depends on the setting of “use General Record storage page” in the extension setup. If you use the “General Record storage page” for categories, all categories will be created in this page. If you disabled “use General Record storage page” all categories from wizards will be created in the current page.
Controlling editing permissions with assigned categories:¶
It's possible to control the editing permissions for news records with the assigned categories. This is either possible by editing the Tsconfig field of the be_user/group or – since tt_news 2.5.0 – by selecting the allowed/visible categories from a category tree in the be_user/group record. The category tree in be_user records appears only if the user is not admin. In the sreenshot below you see a be_user record where the user is only allowed to edit or assign the category “Commitees” and its subcategories.
If thís user opens a news record he will only see the category “Commitees” and its subcategories.
If a BE-user is restricted to certain categories he can only change news records that have these categories assigned. If he performs any action (move, delete, hide, localize, copy, version, modify) with a record that has non-allowed categories assigned an error message will be displayed and the action will be ignored.
Another message will be displayed in the news record above the fields "Type" and "Category". Non-selectable categories will be displayed in grey text and not linked. See screenshot below. Defining allowed categories is also possible by inserting their uids in the Tsconfig field of a be_user or be_group record.
Example:
(user/group TSconfig)
# this enables the use of the list below
options.useListOfAllowedItems = 1
# users of this group are only allowed to save news records with the following categories:
tt_newsPerms.tt_news_cat.allowedItems = 35,36,37
If the BE-user with this configuration opens a record that has at least one category assigned that is not in the list of allowed items he will see the error message below.
The category rootline¶
The tt_news html template contains a marker ###NEWS_CATEGORY_ROOTLINE###. This marker will be filled with the titles of the parent categories of the first assigned category in SINGLE view or with the parents of the selected category in LIST view. It doesn't work in LIST view if more than one category is selected.
The category titles can be linked to the category shortcut page which is configured in the category db-record.
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 = >
}
}
The tt_news_cat database-record¶
The category db-record looks like this:
Field descriptions:
Title and Title language overlays¶
In the field “title language overlays” you can define titles for other languages. If you have more than one additional language, you can split the titles with the “|” symbol. Example: if you have a website with 3 languages (en,de,fr) you write the category title for the default language in the field “Title”. The titles for german an french are stored in the field “title language overlays” like this:
the order of the overlay titles has to be the same as the order of your system languages.In this example: en=0, german=1, french=2
Parent category¶
In the Field “Parent category” you can define the current category as a subcategory of the category which is selected in this field. That will include the current category and the newsitems which have this category assigned when the parent category is selected. This works recursive.
Hide, Start, Stop and Access¶
With the fields “Hide”, “Start”, “Stop” and “Access” you can f.e make this category and the newsitems that have this category assigned only visible for a certain usergroup. Works recursive for subcategories.
Category Image¶
You can upload or assign an image for each news category which is shown in the CATMENU element (“catmenuIconMode = -1”) and as category images (f.e. instead of the category title). The behavour of the category titles/images can be configured in the sheet “Category settings” in the news content element.
The category titles/images can act as shortcut to a page or as “category selector” which means: the contents of a news-list ist filtered by category. Filtering by category works recursive for subcategories.
Category shortcut¶
Category titles or images can also act as shortcut to an internal page. If this is enabled and a visible page is defined as shortcut, the link from the category title or image points to this page.
Target for news category shortcut¶
With the field “Target ...” you can configure a target for the category shortcut (this setting will have priority over a global setting for link targets in your website)
Single-view page for news from this category¶
The field "Single-view page for news from this category" gives you the possibility to define a single-view page for each category. If you want to use this feature it is required to add "useSPidFromCategory = 1" to the TypoScript setup.
If a news-record has 2 or more categories assigned the SinglePid will be taken from the first category which is assigned to the news record.
Description¶
Here you can enter a description for the current category which will be shown as tooltip in the category tree in BE and in the CATMENU content element in FE. If you have long description texts (>70 chars) Firefox and Mozilla will not display the tooltips correctly. Solution: There are some Firefox extensions which correct this problem. I tried "Popup Alt Attribute" which works flawless for me (see screenshot).
Example:C ategory description as tooltip in the category select field:
The SINGLE view¶
The complete view of a news article (single view) has some special features that are not available in LIST or LATEST.
Pagebreaks¶
When you have long articles in SINGLE view, you might want to split them into multiple pages and have a page navigation inserted to navigate between these split pages.
This can be done automatically by specifying the amount of words after that a pagebreak is inserted. When the amount of words is reached, the extension looks for the next dot (.) and inserts a pagebreak after it (default). Alternatively you can configure tt_news to insert pagebreaks only after paragraphs (an empty line in the bodytext field) by setting “useParagraphAsPagebreak=1”.You can disable this feature for each news record (“No automatic pagebreaks for this record”).
You can also add a manual pagebreak at a specific position in the text. At the desired position, enter the text:“<---newpage--->” (default) or the string that you configured as “pagebreakToken”. This will trigger a pagebreak at this position. On the new page, the wordcounter starts again for automatic pagebreaking. However, manual pagebreaks work even when the automatic pagebreak feature is disabled.
The subheader is by default only displayed on the first page of a single view with multiple pages. If this is not wanted the subheader can be configured to appear on all those pages by setting “subheaderOnAllSViewPages=1”.
One thing to note is the way images are handled on multiple pages. The images for the additional pages in single view are asssigned by their position in the Image-list of the news record.
Example: If you have 6 images assigned and “imageCount” for the single view set to “2”, then the first 2 images will appear on the first page, the second two images at the second page and so on.
There is a seperate marker for the pagebrowser in single view:
###NEWS_SINGLE_PAGEBROWSER###
Alternatively it is possible to simply append the pagebrowser to the bodytext without a special marker by setting “appendSViewPBtoContent=1” (this is the default).
Example:
# TS setup
plugin.tt_news {
useMultiPageSingleView = 1
pageBreakToken = <break>
maxWordsInSingleView = 300
useParagraphAsPagebreak = 1
subheaderOnAllSViewPages = 0
appendSViewPBtoContent = 0
}
This will enable the pagebrowser for the Single view. The string “<break>” will trigger a manually pagebreak. If the text is longer than 300 words, a pagebreak will be inserted automatically after the next paragraph (an empty line in the field bodytext). The subheader will be displayed only on the first page and the pagebrowser will be rendered to its own marker (###NEWS_SINGLE_PAGEBROWSER###).
For a detailed description of the TypoScript options that are mentioned here, take a look at the section “Reference”.
The Archive¶
The “news Archive” is always build by two content-elements: An archive-menu (“AMENU”) element and a “LIST” element that shows only archived news-records. The links from the “AMENU” point to that “LIST” element. You can configure the pid (page ID) of the “LIST” in the Constant-editor or directly in TypoScript with “archiveTypoLink.parameter”. The “AMENU” and the (archive)-”LIST” can be on different pages or frames.
The “AMENU” content-element can be considered as a small calender that shows news by their “datetime” field. The value of the field “archivedate” has no influence on the archive-menu.
Note: Unless you're not using “Human readyble Archivedates”it is required to configure this “LIST” to show only archived items. If the LIST is set to “don't care”, it really does't care about archive settings and other archive-related parameters set from the links in the AMENU element -> it will always show all news-records.
tt_news offers a nice feature called “automated archiving” (see -> datetimeDaysToArchive, datetimeHoursToArchive or datetimeMinutesToArchive). If this is enabled, news records with a “datetime” field, that is older than the number of days, given in “datetimeDaysToArchive” will appear in lists showing only archived news (same works for hours and minutes).This means also, that these news records disappear from “LIST” elements showing only non-archived news and they will also disappear from “LATEST” elements.
The displaying behaviour of news content-elements showing archived news is influenced by the TS-variables “enableArchiveDate” and “datetimeDaysToArchive”, “datetimeHoursToArchive” or “datetimeMinutesToArchive”.The following example tries to give you an overview which TypoScript settings will have which effect on different news content elements.
Environment:
Today = 03.10.04datetimeDaysToArchive = 30
news-records will be handled as archived, if their datetime field is older than datetimeDaysToArchive Start (DDTAStart) = 03.09.04
Let's say, you have these news-records:
News 1¶
a
News 1
b
DateTime: 01.11.04 (Future)
c
ArchiveDate: 0 (empty)
News 2¶
a
News 2
b
DateTime: 01.10.04 (Past, after DDTAStart)
c
ArchiveDate: 0 (empty)
News 3¶
a
News 3
b
DateTime: 15.09.04 (Past, after DDTAStart)
c
ArchiveDate: 30.09.04 (Past)
News 4¶
a
News 4
b
DateTime: 01.08.04 (Past, before DDTAStart)
c
ArchiveDate: 30.08.04 (Past)
News 4a¶
a
News 4a
b
DateTime: 01.08.04 (Past, before DDTAStart)
c
ArchiveDate: 0 (empty)
News 5¶
a
News 5
b
DateTime: 01.07.04 (Past, before DDTAStart)
c
ArchiveDate: 01.12.04 (Future)
enable¶
Archive Settings
enable
Archive
Date
b
datetime
DaysTo
Archive
c
d
AMENU
e
LIST
show archived
f
LATEST
g
LIST
show NON archived
h
LIST
don't care
0¶
Archive Settings
0
b
0
c
d
- 2 3 4 4a 5
e
1 2 3 4 4a 5
f
1 2 3 4 4a 5
g
1 2 3 4 4a 5
h
1 2 3 4 4a 5
0¶
Archive Settings
0
b
30
c
d
- - - 4 4a 5
e
- - - 4 4a 5
f
1 2 3 - - -
g
1 2 3 - - -
h
1 2 3 4 4a 5
1¶
Archive Settings
1
b
0
c
d
- 2 3 4 4a -
e
1 2 3 4 4a -
f
1 2 - - 4a 5
g
1 2 - - 4a 5
h
1 2 3 4 4a 5
1¶
Archive Settings
1
b
30
c
d
- - 3 4 4a -
e
- - 3 4 4a 5
f
1 2 - - - -
g
1 2 - - - -
h
1 2 3 4 4a 5
Note that newsitems with an empty archivedate will appear in all lists.Starting from version 2.5.2 newsitems without archivedate will not be displayed in the list of archived items if item is archived according to other criterias (see bugs 3930, 3714). To enable old behavior, set “compatVersion” to “2.5.0” in TypoScript setup.
The Search¶
The tt_news search is a simple text-search that searches in a configurable list of fields (by default this fields will be searched: title, short (subheader), bodytext, author, keywords, links, and imagecaption). The default list of searchfields can be overwritten with the TS parameter “searchFieldList”.
Example:
# this will configure tt_news to search only in the fields “title” and “short”.
plugin.tt_news.searchFieldList = title,short
The fieldnames in “searchFieldList” will be validated before writing them to a database query.
The search can be configured to display its results on another page (see ->searchPid).
Note: The “SEARCH” element does not need a “LIST” element to display its results (if no “searchPid” is defined)
You can choose between displaying all items in the result list when opening the searchpage, or showing only the input form (see -> emptySearchAtStart)
If no global “Starting point” (pid_list) is configured the “Starting Point” of the news “SEARCH” element must point to the folder where your news records are stored.
Version Preview¶
If the extension "version" is enabled on the system, a new "code" (VERSION_PREVIEW) will be added to the "what to display" selector in the tt_news content element. If a content element with this code exists on a page, it does nothing until the GET var "ADMCMD_vPrev" is set which indentifies a version preview. Unfortenutely the id of the page for the version preview is not configurable, so the VERSION_PREVIEW element has to be on the next displayable page above the news sysfolder in the pagetree. This doesn't work if the news folder is in the first level of the pagetree without a normal page above it.
The version preview is triggered by clicking on the red marked preview symbol in the versioning view in the BackEnd.
If a version preview is displayed a message with a link to the original version of the article will be inserted above it. see “versionPreviewMessage_stdWrap” and “versionPreviewMessageLinkToOriginal_stdWrap”.
“direct preview” with the save&preview button doesn't work in editforms of non-public versions of news articles -> use “version preview” instead.
Troubleshooting¶
If the news extension doesn't display anything (not even an error message) check the following:
- did you set a “static template (from Extensions)” in your TS-template?
- is the header of the content element displayed on the website? If this is the case then the news content element seems to be configured correctly
- Are there any news records in the folder where the "Starting point" field points to?
- Did you unhide the news records before saving them.
- If you typed the path to the html-template directly in the TS setup- field: is the html-template located in the correct path? (path is case sensitive)
- Enable the admin panel (config.adminPanel=1) in your TS setup and look for error messages in the “TypoScript” section: (to see the possible TS errors set the checkboxes as shown in the screen shot below)
clear all TYPO3 caches, clear your Browser cache.
FAQ¶
- Q: Is the singlePid required? A: yes, since tt_news 1.3.0 it is not possible to see the single view on the f.e. LIST page when no singlePid was defined.
- Q: What means this error message: "Attempt to insert record on page '[root-level]' (0) where this table, tt_news_cat, is not allowed"? A: That means, that you didn't define a "General Records Storage page" (-> see next question) and so TYPO3 tries to create the new news-category in the rootpage (page id=0).
- Q: what is the "General Records Storage page" (GRSP) and where do I have to set it? A: If you set “use StoragePid” in the extension manager, the "GRSP" points to the page, where to look for categories that are displayed in forms in the BackEnd. The “GRSP” has to be set in the page properties of your websites rootpage (the page with “is root of the website” flag)Remember: The "General Records Storage page" (or “StoragePid”) is not the “Starting Point”
Example:¶
if you have a pagetree like shown in the screenshot below (and “useStoragePid” is enabled), the only page, where you have to set the "General Record Storage page", is the one named "tt_news example 1". All pages below this page will take this setting if it is not overwritten by setting this value in another page.
If your page structure requires, that the news folder(s) are notlocated under one pagetree, you have to set the "General Records Storage page" for each news sysfolder and the rootpage of your site:
Administration¶
Link Configuration¶
There are several kinds of links in a news record. The table below gives you an overview which parameters will affect which link. In the graphic you see the possible links in a news “LATEST” element. The links in the “LIST” elements work exactly like those in “LATEST” elements. The links in the “AMENU” are configured with the same parameters as the “Archive Link” (4). The Links in the “SINGLE” view are explained after this.
¶
Link Description
Link-Configuration
No special settings required
External links will use the target, given in the link-field in the news-record. If there is no target given they will use the global target for external links. Example:
This will open typo3.org in the same window:
¶
Link Description
Link-Configuration
No special settings required
Link-Configuration in Framesets
Required Settings:
The global target for all links has to be defined in your main template (e.g.: PAGE_TARGET = page).
Optional:
If you want the news links to internal pages point to another frame, you can override the global target with this setting.
plugin.tt_news {
pageTypoLink.target = _top
}
Links in “normal” newsitems that points to the single-view.¶
Link Description
Links in “normal” newsitems that points to the single-view.
These links are inserted to the HTML template by the ###LINK_ITEM### markers.
Example:
<!--###LINK_ITEM###-->
###NEWS_IMAGE###
<!--###LINK_ITEM###-->
Link-Configuration
Required Settings: All (red-marked) links will point to the page id=132. This is the page which contains the news “SINGLE” content element (also known as: singlePid).
plugin.tt_news {
singlePid = 132
}
Link-Configuration in Framesets
Required Settings: All (red-marked) links will point to the page id=465 and will open it in the frame that is configured as target for internal links from constants (e.g.: PAGE_TARGET = page).
plugin.tt_news {
singlePid = 465
}
Category Shortcut¶
Link Description
Category Shortcut
Category link: Type “shortcut”
This link points to a page in the same pagetree.
Example:
plugin.tt_news {
catImageMode = 2
}
Link-Configuration
No special settings required
Link-Configuration in Framesets
Required Settings: For category shortcuts that point not to the same frame in which they are displayed, it is required to define the target in the “news category” db record:
Catselector¶
Link Description
Catselector
Category link: Type “category-selector”This link will filter the displayed news or archivemenu-items by category.
Example:
plugin.tt_news {
catTextMode = 3
}
Link-Configuration
No special settings required
Link-Configuration in Framesets
Required Settings:
If the catselector links should point to the current frame, there is no special setting required.
If the catselector links should point to another frame, add this to your TS setup:
plugin.tt_news {
itemLinkTarget = page
catSelectorTargetPid = 78
}
with this setting the catselector links point to page id=78 in the frame named “page”.
Archive Link¶
Link Description
Archive Link
- used in the “LATEST” element (example html-template) for the link that points to the page with the archive listing (marker: ###GOTOARCHIVE###)- and used for links in the “AMENU” element (archive menu). If you want the links in the archive menu point to another page, you can enter the PID of this page here.
Link-Configuration
Required Settings:
plugin.tt_news {
archiveTypoLink.parameter = 34
}
In the example the “Archive Link” in the LATEST element points to the page with id=34. This page contains an “AMENU” content-element. The links in the “AMENU” element are configured with the same settings, but those links expect a page with a “LIST” element as target. That page is configured to list only archived newsitems.If you set this value from the Contstant-Editor for all news content-elements, this “LIST” has to be on the same page as the “AMENU”. The target for this link is configured as the global PAGE_TARGET in constants.
See section “The Archive” for more information about linking the “AMENU” to other news content elements or pages.
Pagebrowser links¶
Link Description
Pagebrowser links
(not in the graphic)
Link-Configuration
No special settings required.
The pagebrowser links in “LIST” view will point to the global “PAGE_TARGET” if one is defined in the constants.
Links in the “SINGLE” view
Some of the link-types in the single view are configured with the same parameters as shown in the table above:
- Links to internal pages (see -> getRelatedCObject)
- Links to external URLs (see -> getRelatedCObject)
- Category-links that point to category-shortcuts (2) (the catselector mode will not work - and does not make sense - in single view)
Links to Files¶
Link Description
Links to Files
Link-Configuration
The links to files are configured with the “filelink” object.
(see -> newsFiles)
News Links¶
Link Description
News Links
Link-Configuration
The news “Links” are parsed through the “general_stdWrap”.
(see -> general_stdWrap)
Hint:
you can add “typolinks” to this field:
<LINK http://mysite.com _blank>open mysite</LINK>
This will open the linked site in a new browser window. The link will appear as “open mysite” in SINGLE view.
Back-Link¶
Link Description
Back-Link
Link-Configuration
This links points to the last “LIST” or “LATEST” view. Usually the page that linked to the “SINGLE” view.
(see -> backPid)
Image Link in Single view¶
Link Description
Image Link in Single view
Link-Configuration
No special settings required, in the default configuration these links point to a javascript that opens the image in a pop-up window.
(see -> imageWrapIfAny )
Email link¶
Link Description
Email link
Text Links in news bodytext
Link-Configuration
No special settings required
This links use the global settings for links
Search page id¶
Link Description
Search page id
(not in the graphic)
Link-Configuration
If you want the search button in the “SEARCH” content element point to another page than the current you can define this page as “searchPid”. (see -> searchPid )
User Tsconfig¶
You can configure many options of the tt_news BE-form by editing the TSconfig field of the BE-user or the BE-Group this user is a member of.
((generated))¶
Examples:¶
This will enable the use of “allowed categories” and adds the categories with uids 23,43,12 to this list (see section “Categories” for mre information)
options.useListOfAllowedItems = 1
tt_newsPerms.tt_news_cat.allowedItems = 35,36,37
This will exclude the categories with uids 1,2,3 from showing in the category tree in BE-forms:
tt_newsPerms.tt_news_cat.excludeList = 1,2,3
This will show only the categories with uids 4,5,6 in the category tree in BE-forms:
tt_newsPerms.tt_news_cat.includeList = 4,5,6
This will add a "Save & New" button to news and news-categories BE- forms
options.saveDocNew.tt_news = 1
options.saveDocNew.tt_news_cat = 1
This will remove the "Delete" button from the news categories form.
options.disableDelete.tt_news_cat = 1
This will set the field “hidden” in new created news articles to 0 (=visible)
TCAdefaults.tt_news.hidden = 0
If you click on the "TS" button in the right of the textarea you'll see all possible options in a pop-up window.
More information about “User TSconfig” can be found here: http://typo3.org/documentation/document- library/references/doc_core_tsconfig/4.0.0/view/1/2/
Page TSconfig¶
Since tt_news 2.2.0 it's possible to open a news article in the SINGLE view when clicking the “save & preview” button in the news record in the BackEnd (works only in the “Live” workspace). The “singlePid” for the page who should open the SINGLE view has to be configured in the Page TSconfig of the folder with the news records. This page can be the normal SINGLE view page for your website it could also point to another page which contains a tt_news content element with code SINGLE.
((generated))¶
Example¶
This will open the page with id 37 when clicking on the “save & preview” button in a news record:
tx_ttnews.singlePid = 37
If you, e.g. want to hide only certain options of some fields for BE- Users, you can do this by editing the Page-TSconfig of the folder where your tt_news db-records are stored. (these settings will affect all BE users including those with admin rights)
Example¶
This will remove the option "external Url" (type=2) from the "type" field in the tt_news db-record:
TCEFORM.tt_news.type.removeItems = 2
The Rich-Text-Editor¶
I recommend to use the extension “ htmlarea RTE ” (extkey: rtehtmlarea) instead of the RTE (extkey: rte) which is included in your TYPO3 package. One big advantage of rtehtmlarea is, that it works on almost all browsers and operating systems. The classic RTE works only in Internet Explorer because it depends on some ActiveX-controls which are (fortenutely) not available in other browsers.
Since tt_news v1.4.2 the RichText-Editor for news is configured like the RTE for normal content (e.g. Text, Text w/image). This is done at three places:
1. By this line in tca.php:
[line: 405]
'0' => Array('showitem' => 'title,type;;1;;,datetime;;2;;1-1-1,author;;3;;,short,bodytext;;4;
richtext[paste|bold|italic|underline|formatblock|class|left|center|right|orderedlist|unorderedlist|
outdent|indent|link|table|image]:rte_transform[flag=rte_enabled|mode=ts];4-4-4,no_auto_pb,
--div--;Relations,category,image;;;;1-1-1,imagecaption;;5;;,links;;;;2-2-2,related;;;;3-3-3,
news_files;;;;4-4-4'),
which confgures which buttons or features will be available in the RTE-interface and it sets also the basic “transformation mode” (mode=ts). The transformation mode defines how the content of the field is changed while storing it in the database and while getting it back from the database. A nice graphic that shows how and where transformations work, can be found on this page: http://typo3.org/documentation/document-library/core- documentation/doc_core_api/4.0.0/view/5/2/
2. If the extension “css_styled_content” is enabled, the transformation mode is changed to “ts_css” by adding this lines as “default pageTSconfig”:
# RTE mode in table "tt_news"
RTE.config.tt_news.bodytext.proc.overruleMode=ts_css
This mode enables the use of CSS-classes for formatting the contents of the news record (e.g. HTML-lists will be generated with tags like <ul>,<li> and <ol>, headers will be rendered as <h1> - <h6>... for a detailed view on the changes between the different transformation modes take a look at this page: http://typo3.org/documentation /document-library/core- documentation/doc_core_api/4.0.0/view/5/2/#id2828212
3. The third part of the RTE configuration is done by this line in the file static/ts_new/setup.txt or static/ts_old/setup.txt in the extension dir (the settings in these files will be enabled by adding one of them as “static templates from extensions” to your TS template):
plugin.tt_news.general_stdWrap {
parseFunc < tt_content.text.20.parseFunc
}
The “general_stdWrap” is used additionally to the normal standardWraps (f.e. subheader_stdWrap) for the following fields: “author”, “subheader”, “text” and “links”. That means, the processing of these fields can be changed by modifying one line of TypoScript. If this behaviour is not wanted for a certain site, it can be disabled by clearing the “parseFunc”:
plugin.tt_news.general_stdWrap {
parseFunc >
}
But then you'll have to add a “parseFunc” to every field which contents should be processed (f.e. to find mailadresses in the text and add <a href=”mailto:...” to them).
“< tt_content.text.20.parseFunc” means, that the parseFunc- configuration from the field “text” from tt_content is also taken for the tt_news-fields which are processed by the “general_stdWrap”. If you want to change the configuration of “tt_content.text.20.parseFunc”, open this value in the “TypoScript Object Browser” (see screenshot at the begínning of the section “Reference”).
If you want to change the appearance of the RTE in BE forms, you can overwrite the default settings in “page TSconfig”. To see the current TSconfig settings for your site, you can use the tool: “View TS config fields content” from “Web>Info, page TSconfig”.
The RTE configuration can also be changed by “RTE.default” settings added by other extensions. If you have the extension “CSS_styled_content” installed, and you did not change the default setting: “Set PageTSconfig by default=on”, this value will overwrite the transform settings for tt_news given in tca.php (the codeline above).
The following table shows the pageTSconfig settings for the site, from the screenshot above (“RTE.default” means that in this site the RTE processing for tt_news is configured like the processing for tt_content). All settings are done in the page “tt_news example 1” (is root-page). The sysfolder for news is located under this page, so the settings from the “root-page” will also affect this folder.
content(default)¶
Template settings
content(default)
EXTcss_styled_content
Installed
Add to Page TS-config
RTE.default {
proc {
preserveTables = 1
overruleMode = ts
}
}
content(default)¶
Template settings
content(default)
EXTcss_styled_content
Not installed, or pageTS config not added by default.
Add to Page TS-config
RTE.default {
proc {
preserveTables = 1
overruleMode = ts
}
showButtons = table
}
css_styled_content¶
Template settings
css_styled_content
EXTcss_styled_content
Installed
Add to Page TS-config
no special settings needed. The “overrule mode” is added to the default pageTSconfig.
Notice: If your news sysfolders are not located under your website's “root-page” you'll have to add the settings from the table above to the PageTSconfig of your news sysfolders.
((generated))¶
Example:¶
The settings that start with “RTE.default” will affect the RTE for tt_news and tt_content (and all RTEs from other extensions). If you want to configure the RTE for tt_news different from the RTE for tt_content, the syntax looks like this (pageTSconfig):
RTE.config.tt_news.bodytext {
proc {
preserveTables = 1
overruleMode = ts_css
}
showButtons = textcolor,bgcolor
}
for further details see:
http://typo3.org/documentation/document-library/rtehtmlarea/
http://typo3.org/documentation/document-library/extension- manuals/rtehtmlarea/current/
http://typo3.org/documentation/tips-tricks/customizing-the-rich-text- editor/
http://typo3.org/documentation/document-library/core- documentation/doc_core_api/4.0.0/view/5/1/
Rights & Permissions¶
The basics about the Rights & Permissions concepts of TYPO3 can be found in the "getting started" document: http://typo3.org/documentation/document- library/tutorials/doc_tut_quickstart/0.1.0/view/1/12/#id2856932
for some advanced options see section “MOD” in “doc_core_tsconfig”: http://typo3.org/documentation/document- library/references/doc_core_tsconfig/4.0.0/view/1/3/#id2798076
Caching¶
Since version 1.4.0 tt_news supports caching and thus indexing by the indexed_search extension. Now the problem appears that you'll have to clear the cache for the e.g. “Homepage” to see the changes you made in a news article that is located in the news sysfolder.
This can be done automatically.
((generated))¶
Example:¶
in the small pagetree below, the news articles are located in the sysfolder "News db Records". The page "Home"(647) shows a news LATEST content element in the left column and the page "News"(637) and its subpages show other news content elements.
If a user changes an item in the news sysfolder, the pages "Home" and "News" will still show the same content (assuming that caching is enabled).
If you add the following parameters to the PageTSconfig of the news sysfolder, the cache for the pages configured in the “clearCacheCmd” is automatically cleared by saving a news record in this folder.
TCEMAIN.clearCacheCmd = 647,637
for more options see: http://typo3.org/documentation/document- library/references/doc_core_tsconfig/4.0.0/view/1/3/#id2798076
Configuration¶
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/
Files:¶
pi/class.tx_ttnews.php¶
File
pi/class.tx_ttnews.php
Description
Main PHP-class used to display news. Called from a USER cObject with "userFunc = user_news->main_news"
class.ext_update.php¶
File
class.ext_update.php
Description
This is the tt_news updater
class.tx_ttnews_tcemain.php¶
File
class.tx_ttnews_tcemain.php
Description
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¶
File
class.tx_ttnews_treeview.php
Description
This class builds the “category tree” in BE forms and checks for recursive categories
class.tx_ttnews_itemsProcFunc.php¶
File
class.tx_ttnews_itemsProcFunc.php
Description
Contains the function, that adds “extra codes” to the “What to display” selector
pi/news_template.tmpl¶
File
pi/news_template.tmpl
Description
The table-based tt_news template file.
pi/news_help.tmpl¶
File
pi/news_help.tmpl
Description
Template, which is displayed when using the news extension without setting a value for "code"
res/example_itemMarkerArrayFunc.php¶
File
res/example_itemMarkerArrayFunc.php
Description
Example for processing user-defined Markers with the userfunction: “itemMarkerArrayFunc”. (See file for description and needed TS setup)
res/example_imageMarkerFunc.php¶
File
res/example_imageMarkerFunc.php
Description
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¶
File
res/example_userPageBrowserFunc.php
Description
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¶
File
folders:static/ts_new
static/css
static/ts_old
static/rss_feed
Description
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¶
File
pi/tt_news_v2_template.html
Description
The new CSS based html-template
res/tt_news_v2_styles.css¶
File
res/tt_news_v2_styles.css
Description
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¶
File
res/rss_0_91.tmpl
res/rss_2.tmpl
res/atom_0_3.tmpl
res/atom_1_0.tmpl
res/rdf.tmpl
Description
The xml templates for web feeds as RSS 0.91, RSS 2, RDF, Atom 0.3 and Atom 1.0.
res/realurl_localconf.txt¶
File
res/realurl_localconf.txt
Description
Example Configuration for tt_news with RealUrl
Reference¶
plugin.tt_news properties: TS configuration.
General Settings¶
templateFile¶
Property
templateFile
Data type
resource
Description
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
}
Default
pid_list¶
Property
pid_list
Data type
string / stdWrap
Description
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).
Default
dontUsePidList¶
Property
dontUsePidList
Data type
boolean
Description
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
Default
recursive¶
Property
recursive
Data type
Int / stdWrap
Description
If this is given, the “pid_list” is extended by the number of recursive levels.
Example:
plugin.tt_news.recursive = 3
Default
code¶
Property
code
Data type
string / stdWrap
Description
Code to define, what the script does.
Example:
plugin.tt_news.code = LATEST
Default
singlePid¶
Property
singlePid
Data type
int+ / stdWrap
Description
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)
Default
allowCaching¶
Property
allowCaching
Data type
boolean
Description
Allow caching of news.
Default
1
limit¶
Property
limit
Data type
int+ / stdWrap
Description
The maximum number of news-records showing in “LIST” view.
Default
7
latestLimit¶
Property
latestLimit
Data type
int+ / stdWrap
Description
The maximum number of news-records showing in “LATEST” view.
Default
3
alternatingLayouts¶
Property
alternatingLayouts
Data type
Int+
Description
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.
Default
2
altMainMarkers¶
Property
altMainMarkers
Data type
(array of strings)
Description
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_LATEST
TEMPLATE_LIST
TEMPLATE_SINGLE
TEMPLATE_SINGLE_RECORDINSERT
TEMPLATE_ARCHIVE
TEMPLATE_SEARCH
TEMPLATE_ARCHIVE_NOITEMS
TEMPLATE_HEADER_LIST
TEMPLATE_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 = ### | ###
}
Default
compatVersion¶
Property
compatVersion
Data type
version
Description
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:
- 2.5.0 or below
- LIST view in archive mode will show not only archived items but also any item without archivedate set
Default
Settings for Links:¶
useHRDates¶
Property
useHRDates
Data type
boolean
Description
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.
Default
0
useHRDatesSingle¶
Property
useHRDatesSingle
Data type
boolean
Description
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:
Default
0
useHRDatesSingleWithoutDay¶
Property
useHRDatesSingleWithoutDay
Data type
boolean
Description
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
}
Default
0
backPid¶
Property
backPid
Data type
int+
Description
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.
Default
dontUseBackPid¶
Property
dontUseBackPid
Data type
boolean
Description
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.
Default
0
hscBackLink¶
Property
hscBackLink
Data type
boolean
Description
If this is enabled the “Back to list” link in the SINGLE view will be parsed through the PHP function htmlspecialchars().
Default
1
pageTypoLink¶
Property
pageTypoLink
Data type
->typolink
Description
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
}
Default
itemLinkTarget¶
Property
itemLinkTarget
Data type
string
Description
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.
Default
archiveTypoLink¶
Property
archiveTypoLink
Data type
->typolink
Description
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.
- used in the “LATEST” element (example html-template) for the link that points to the page with the archive listing (marker: ###GOTOARCHIVE###)
- used for links in the “AMENU” element (archive menu). If you want the links in the archive menu point to another page, you can enter the PID of this page here.
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
}
Default
linkTitleField¶
Property
linkTitleField
Data type
string /stdWrap
Description
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>
Default
Global Wraps¶
I f 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.
wrap1¶
Property
wrap1
Data type
-> stdWrap
Description
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>
Default
wrap2¶
Property
wrap2
Data type
-> stdWrap
Description
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.
Default
wrap3¶
Property
wrap3
Data type
-> stdWrap
Description
Global Wrap 3 (see above)
Default
color1¶
Property
color1
Data type
string /stdWrap
Description
Value for ###GC1### marker (Global color 1)
Default
color2¶
Property
color2
Data type
string /stdWrap
Description
Value for ###GC2### marker (Global color 2)
Default
color3¶
Property
color3
Data type
string /stdWrap
Description
Value for ###GC3### marker (Global color 3)
Default
color4¶
Property
color4
Data type
string /stdWrap
Description
Value for ###GC4### marker (Global color 4)
Default
Search Settings¶
searchPid¶
Property
searchPid
Data type
int+
Description
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.
Default
emptySearchAtStart¶
Property
emptySearchAtStart
Data type
boolean
Description
If this is set the “SEARCH” content element will show an empty list at start. Otherwise the full list of items is shown.
Default
1
searchEmptyMsg_stdWrap¶
Property
searchEmptyMsg_stdWrap
Data type
->stdWrap
Description
stdWrap for the messages from the news-search: “no results” & “no searchword given”.
Default
Pagebrowser Settings¶
noPageBrowser¶
Property
noPageBrowser
Data type
boolean
Description
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.
Default
0
latestWithPagebrowser¶
Property
latestWithPagebrowser
Data type
boolean
Description
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.
Default
0
usePiBasePagebrowser¶
Property
usePiBasePagebrowser
Data type
boolean
Description
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.
Default
0
pageBrowser¶
Property
pageBrowser
Data type
pageBrowser configuration array
Description
Configuration array for the pagebrowser. All properties of the pagebrowser are configured in this array.
Default
-> pageBrowser.[options]¶
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.
maxPages¶
Property
maxPages
Data type
int+
Description
The maximum number of pages that are shown in the pagebrowser
Default
7
showPBrowserText¶
Property
showPBrowserText
Data type
boolean
Description
Here you can choose if the pagebrowser should show texts like “page 1, page...” in the pagelinks or if it should show only numbers.
Default
1
dontLinkActivePage¶
Property
dontLinkActivePage
Data type
boolean
Description
If this is set to 1 the current page is not linkedlinked in the pagebowser
Default
1
tableParams¶
Property
tableParams
Data type
string
Description
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.xmlbut 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”.
Default
showResultCount¶
Property
showResultCount
Data type
0,1,2
Description
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:
- 0: only the result-browser will be shown
- 1: (default) the text "Displaying results..." and the result-browser will be shown.
- 2: only the text "Displaying results..." will be shown
Default
1
alwaysPrev¶
Property
alwaysPrev
Data type
boolean
Description
If this is enabled the “previous” link will always be visible even when the first page is displayed.
Default
0
showFirstLast¶
Property
showFirstLast
Data type
boolean
Description
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).
Default
0
hscText¶
Property
hscText
Data type
boolean
Description
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.
Default
1
pagefloat¶
Property
pagefloat
Data type
int / keyword
Description
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.
Default
0
showRange¶
Property
showRange
Data type
boolean
Description
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...
Default
0
browseBoxWrap¶
Property
browseBoxWrap
Data type
stdWrap
Description
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>
}
Default
showResultsWrap¶
Property
showResultsWrap
Data type
stdWrap
Description
This wraps the text “Displaying results...”.
Default
browseLinksWrap¶
Property
browseLinksWrap
Data type
stdWrap
Description
Wrap for the browse links.
Default
showResultsNumbersWrap¶
Property
showResultsNumbersWrap
Data type
stdWrap
Description
wrap for the numbers in the text: “Displaying results 1 to 4 out of 22 ”.
Default
disabledLinkWrap¶
Property
disabledLinkWrap
Data type
stdWrap
Description
wrap for disabled links (f.e the “Last >>” link on the last page).
Default
inactiveLinkWrap¶
Property
inactiveLinkWrap
Data type
stdWrap
Description
wrap for inactive links (normal links).
Default
activeLinkWrap¶
Property
activeLinkWrap
Data type
stdWrap
Description
wrap for active links.
Default
Archive Settings¶
archive¶
Property
archive
Data type
int
Description
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)
- -1 = show only non-archived
- 0 = don't care
- 1 = show only archived
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.
Default
datetimeDaysToArchive¶
Property
datetimeDaysToArchive
Data type
int (days)
Description
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
Default
0
datetimeHoursToArchive¶
Property
datetimeHoursToArchive
Data type
int (hours)
Description
Same as datetimeDaysToArchive but for hours (can't be combined with datetimeDaysToArchive and datetimeMinutesToArchive).
Default
0
datetimeMinutesToArchive¶
Property
datetimeMinutesToArchive
Data type
int (minutes)
Description
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
Default
0
enableArchiveDate¶
Property
enableArchiveDate
Data type
boolean
Description
If set, the field "archivedate" is activated for selecting of news records.
Default
1
emptyArchListAtStart¶
Property
emptyArchListAtStart
Data type
boolean
Description
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.
Default
archiveMode¶
Property
archiveMode
Data type
string
Description
Determines which archive mode is used
possible values: “month”, “year” or “quarter” (see “archiveTitleCObject”)
Example:
plugin.tt_news.archiveMode = month
Default
month
archiveTitleCObject¶
Property
archiveTitleCObject
Data type
cObject
Description
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
}
}
}
}
Default
archiveHeader_stdWrap¶
Property
archiveHeader_stdWrap
Data type
->stdWrap
Description
stdWrap for the archive header.
Default
archiveEmptyMsg_stdWrap¶
Property
archiveEmptyMsg_stdWrap
Data type
->stdWrap
Description
stdWrap for the message, that is displayed if no archived items are found at all
Default
Display Settings for “SINGLE”,”LIST” and “LATEST”¶
general_stdWrap¶
Property
general_stdWrap
Data type
->stdWrap
Description
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.
Default
excludeLatestFromList¶
Property
excludeLatestFromList
Data type
boolean
Description
[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.
Default
0
listStartId¶
Property
listStartId
Data type
int+
Description
[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 5 th record, found in the db. (counting starts at zero)
plugin.tt_news {
listStartId = 4
limit = 3
}
Default
excludeAlreadyDisplayedNews¶
Property
excludeAlreadyDisplayedNews
Data type
boolean
Description
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.
Default
0
displayArchivedInLatest¶
Property
displayArchivedInLatest
Data type
boolean
Description
By setting this to “1” you can display archived news in the “LATEST” template
Default
0
listOrderBy¶
Property
listOrderBy
Data type
string
Description
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.
Default
datetime desc
listGroupBy¶
Property
listGroupBy
Data type
string
Description
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
}
Default
title_stdWrap¶
Property
title_stdWrap
Data type
->stdWrap
Description
stdWrap for display of the title field.
Default
author_stdWrap¶
Property
author_stdWrap
Data type
->stdWrap
Description
stdWrap for display of the author field.
Default
email_stdWrap¶
Property
email_stdWrap
Data type
->stdWrap
Description
stdWrap for display of the email field.
Default
subheader_stdWrap¶
Property
subheader_stdWrap
Data type
->stdWrap
Description
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.
Default
content_stdWrap¶
Property
content_stdWrap
Data type
->stdWrap
Description
stdWrap for display of the news content (field: bodytext).
Default
keywords_stdWrap¶
Property
keywords_stdWrap
Data type
->stdWrap
Description
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.
Default
links_stdWrap¶
Property
links_stdWrap
Data type
->stdWrap
Description
stdWrap for the complete links section in the SINGLE view
Default
linksHeader_stdWrap¶
Property
linksHeader_stdWrap
Data type
->stdWrap
Description
stdWrap for header of the links section.
Default
linksItem_stdWrap¶
Property
linksItem_stdWrap
Data type
->stdWrap
Description
stdWrap for a single link.
Default
addInfo_stdWrap¶
Property
addInfo_stdWrap
Data type
->stdWrap
Description
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”.
Default
useBidirectionalRelations¶
Property
useBidirectionalRelations
Data type
boolean
Description
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
Default
usePagesRelations¶
Property
usePagesRelations
Data type
boolean
Description
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.
Default
noNewsIdMsg_stdWrap¶
Property
noNewsIdMsg_stdWrap
Data type
->stdWrap
Description
stdWrap for the error message that is diplayed when a user enters the single-view page without the GET var &tx_ttnews[tt_news].
Default
noNewsToListMsg_stdWrap¶
Property
noNewsToListMsg_stdWrap
Data type
->stdWrap
Description
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>
Default
substitutePagetitle¶
Property
substitutePagetitle
Data type
boolean
Description
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
Default
SINGLE view with pagebreaks¶
useMultiPageSingleView¶
Property
useMultiPageSingleView
Data type
boolean
Description
This enables pagebreaks for the SINGLE view or is enabled automaticly when “maxWordsInSingleView” has a value. Pagebreaks are insertedafter 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
}
Default
0
pageBreakToken¶
Property
pageBreakToken
Data type
string
Description
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>
}
Default
<---newpage--->
maxWordsInSingleView¶
Property
maxWordsInSingleView
Data type
int+
Description
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” .
Default
0
useParagraphAsPagebreak¶
Property
useParagraphAsPagebreak
Data type
boolean
Description
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.
Default
0
singleViewPointerName¶
Property
singleViewPointerName
Data type
string
Description
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
}
Default
sViewPointer
subheaderOnAllSViewPages¶
Property
subheaderOnAllSViewPages
Data type
boolean
Description
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.
Default
0
appendSViewPBtoContent¶
Property
appendSViewPBtoContent
Data type
boolean
Description
The pagebrowser for the SINGLE view can be inserted into the content in two different ways:
- 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
}
Default
0
News Images¶
imageCount¶
Property
imageCount
Data type
int+
Description
Number of images from the list of images to display.
Example:
This will supress images in list view.
plugin.tt_news.displayList.imageCount = 0
Default
1
imageWrapIfAny¶
Property
imageWrapIfAny
Data type
wrap
Description
If there is any image code returned, this wraps those images
Default
image¶
Property
image
Data type
->imgResource
->stdWrap
Description
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
Default
image.noImage_stdWrap¶
Property
image.noImage_stdWrap
Data type
->stdWrap
Description
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
}
}
}
}
Default
firstImageIsPreview¶
Property
firstImageIsPreview
Data type
boolean
Description
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
Default
forceFirstImageIsPreview¶
Property
forceFirstImageIsPreview
Data type
boolean
Description
Works like firstImageIsPreview but always removes the first image from SINGLE view, even if only one image is attached.
Default
News Files¶
newsFiles¶
Property
newsFiles
Data type
-> filelink
Description
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>
}
}
Default
newsFilesHeader_stdWrap¶
Property
newsFilesHeader_stdWrap
Data type
->stdWrap
Description
stdWrap for the header of the “attached files” section in your template.
Default
newsFiles_stdWrap¶
Property
newsFiles_stdWrap
Data type
->stdWrap
Description
stdWrap for the list of attached files
Default
Date & Time wraps¶
date_stdWrap¶
Property
date_stdWrap
Data type
->stdWrap
Description
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”.
Default
time_stdWrap¶
Property
time_stdWrap
Data type
->stdWrap
Description
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”.
Default
age_stdWrap¶
Property
age_stdWrap
Data type
->stdWrap
Description
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
Default
1
textNewsAge_stdWrap¶
Property
textNewsAge_stdWrap
Data type
->stdWrap
Description
stdWrap for the age text: ( “age:”)
Default
Category Settings¶
useSubCategories¶
Property
useSubCategories
Data type
boolean
Description
This enables the use of subcategories for selecting news for display in the FrontEnd.
Default
displaySubCategories¶
Property
displaySubCategories
Data type
boolean
Description
This enables the display of subcategories in the FrontEnd.
Example:
plugin.tt_news {
useSubCategories = 1
displaySubCategories = 1
}
Default
catExcludeList¶
Property
catExcludeList
Data type
string
Description
List of categories that should not be displayed in news articles in LIST, LATEST and SINGLE.
Default
categoryMode¶
Property
categoryMode
Data type
int
Description
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).
- 2 = Show news which have all selected categories assigned (AND)
- 1 = Show news which have at least one of the selected categories assigned (OR)
- 0 = Show all. Don't care about category selections
- -1 = Show news which not have all of the selected categories assigned (AND)
- -2 = Show news which have none of the selected categories assigned (OR)
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.
Default
categorySelection¶
Property
categorySelection
Data type
Int+ / list /
->stdWrap
Description
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
}
Default
catImageMode¶
Property
catImageMode
Data type
int
Description
Display mode for category images.
- 0 – No category images will be displayed
- 1 – Category images will be displayed but not linked
- 2 – Category images will be displayed and function as shortcut link.
- 3 – Category images will be displayed and function as category selector
Example:
# don't display any category images
plugin.tt_news.catImageMode = 0
Default
2
catTextMode¶
Property
catTextMode
Data type
int
Description
Display mode for category texts (titles).
- 0 – No category texts will be displayed
- 1 – Category texts will be displayed but not linked
- 2 – Category texts will be displayed and function as shortcut link.
- 3 – Category texts will be displayed and function as category selector
Example:
# don't display any category titles
plugin.tt_news.catTextMode = 0
Default
1
catSelectorTargetPid¶
Property
catSelectorTargetPid
Data type
Int+
Description
Set this value to let the links from categories in “catSelector” mode point to another page than the current page (catImageMode or catTextMode = 3).
Default
latestWithCatSelector¶
Property
latestWithCatSelector
Data type
boolean
Description
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
Default
category_stdWrap¶
Property
category_stdWrap
Data type
->stdWrap
Description
stdWrap for the complete category section.
Default
categoryTitles_stdWrap¶
Property
categoryTitles_stdWrap
Data type
->stdWrap
Description
stdWrap for all category titles.
Default
categoryImages_stdWrap¶
Property
categoryImages_stdWrap
Data type
->stdWrap
Description
stdWrap for all category images.
Default
categoryTitleItem_stdWrap¶
Property
categoryTitleItem_stdWrap
Data type
->stdWrap
Description
stdWrap for a single category title.
Default
subCategoryTitleItem_stdWrap¶
Property
subCategoryTitleItem_stdWrap
Data type
->stdWrap
Description
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>
}
}
Default
categoryImgItem_stdWrap¶
Property
categoryImgItem_stdWrap
Data type
->stdWrap
Description
stdWrap for a single category image.
Default
subCategoryImgItem_stdWrap¶
Property
subCategoryImgItem_stdWrap
Data type
->stdWrap
Description
stdWrap for a single subcategory image.
Default
catImageMaxWidth¶
Property
catImageMaxWidth
Data type
int+
Description
Maximum width of category images.
Default
20
catImageMaxHeight¶
Property
catImageMaxHeight
Data type
int+
Description
Maximum height of category images.
Default
20
catTextLength¶
Property
catTextLength
Data type
int+
Description
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.
Default
maxCatImages¶
Property
maxCatImages
Data type
int+
Description
Maximum number of displayed category images.
Default
maxCatTexts¶
Property
maxCatTexts
Data type
int+
Description
Maximum number of displayed category texts.
Default
catOrderBy¶
Property
catOrderBy
Data type
string
Description
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.
Default
useSPidFromCategory¶
Property
useSPidFromCategory
Data type
boolean
Description
Here you can enable the use of the singlePid which is configured in the category record.
Default
0
categoryDivider¶
Property
categoryDivider
Data type
string
Description
The value inserted here appears between the category titles which are shown in news records.
Default
,
categoryDivider_stdWrap¶
Property
categoryDivider_stdWrap
Data type
->stdWrap
Description
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 = || |
}
Default
Settings for the catRootline -> catRootline.[options]¶
The category rootline is rendered to the template marker ###NEWS_CATEGORY_ROOTLINE###. All settings here start with “catRootline.”
showCatRootline¶
Property
showCatRootline
Data type
boolean
Description
If this is enabled tt_news will show the category rootline
Default
0
catRootline_stdWrap¶
Property
catRootline_stdWrap
Data type
->stdWrap
Description
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 = >
}
}
Default
linkTitles¶
Property
linkTitles
Data type
boolean
Description
Switch which configures if categories are linked or not.
Default
1
title_stdWrap¶
Property
title_stdWrap
Data type
->stdWrap
Description
stdWrap for a single category title in the category rootline
Default
divider¶
Property
divider
Data type
string
Description
This string is inserted between the category titles in the category rootline
Default
Display Settings for “XML”¶
rss091_tmplFile¶
Property
rss091_tmplFile
Data type
resource
Description
XML template for RSS 0.91 feed
Default
rss2_tmplFile¶
Property
rss2_tmplFile
Data type
resource
Description
XML template for RSS 2.0 feed
Default
atom03_tmplFile¶
Property
atom03_tmplFile
Data type
resource
Description
XML template for Atom 0.3 feed
Default
atom1_tmplFile¶
Property
atom1_tmplFile
Data type
resource
Description
XML template for Atom 1.0 feed
Default
rdf_tmplFile¶
Property
rdf_tmplFile
Data type
resource
Description
XML template for RDF feed
Default
xmlFormat¶
Property
xmlFormat
Data type
string
Description
Defines the format of the news feed. Possible values are:
rss091, rss2, rdf, atom03 and atom1
Default
rss2
xmlTitle¶
Property
xmlTitle
Data type
string
Description
The title of your news feed.
(required for rss091, rss2, rdf, atom03, atom1)
Default
xmlLink¶
Property
xmlLink
Data type
string
Description
The link to your hompage.
(required for rss091, rss2, rdf, atom03, recommended for atom1)
Default
xmlDesc¶
Property
xmlDesc
Data type
string
Description
The description of your news feed.
(required for rss091, rss2, rdf, optional for atom03, optional for atom1)
Default
xmlLang¶
Property
xmlLang
Data type
string
Description
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)
Default
en
xmlIcon¶
Property
xmlIcon
Data type
string
Description
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
}
Default
xmlCopyright¶
Property
xmlCopyright
Data type
string
Description
Copyright notice for content in the channel. Maximum length is 100
(optional for rss091, rss2, atom03, atom1, not available for rdf)
Default
xmlManagingEditor¶
Property
xmlManagingEditor
Data type
string
Description
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)
Default
xmlWebMaster¶
Property
xmlWebMaster
Data type
string
Description
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)
Default
xmlLastBuildDate¶
Property
xmlLastBuildDate
Data type
boolean
Description
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)
Default
1
xmlLimit¶
Property
xmlLimit
Data type
int+
Description
Limit for news records in the RSS/XML feed
Example:
plugin.tt_news.displayXML {
xmlLimit = 10
}
Default
10
xmlCaching¶
Property
xmlCaching
Data type
boolean
Description
Allow caching for the RSS/XML feed
Default
1
dontInsertSiteUrl¶
Property
dontInsertSiteUrl
Data type
boolean
Description
If set, the links in the XML feeds are not preprended with the siteUrl.
Default
0
::¶
Property
xmlDeclaration
Data type
string
Description
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"?>
}
Default
Language settings¶
sys_language_mode¶
Property
sys_language_mode
Data type
string
Description
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”
Default
showNewsWithoutDefaultTranslation¶
Property
showNewsWithoutDefaultTranslation
Data type
boolean
Description
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.
Default
0
showLangLabels¶
Property
showLangLabels
Data type
Description
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
}
}
Default
0
showFlags¶
Property
showFlags
Data type
boolean
Description
Display flag Image.
Default
0
flagPath¶
Property
flagPath
Data type
string
Description
Path to the flag-images.
If this is empty, the flags from “typo3/gfx/flags/” are taken
Default
flagImage¶
Property
flagImage
Data type
-> IMAGE
Description
Flag image configuration array.
Default
Other Settings¶
defaultCode¶
Property
defaultCode
Data type
string
Description
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
Default
displayCurrentRecord¶
Property
displayCurrentRecord
Data type
boolean
Description
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".
Default
itemMarkerArrayFunc¶
Property
itemMarkerArrayFunc
Data type
string
Description
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.
Default
imageMarkerFunc¶
Property
imageMarkerFunc
Data type
string
Description
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.
Default
userPageBrowserFunc¶
Property
userPageBrowserFunc
Data type
string
Description
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.
Default
_LOCAL_LANG¶
Property
_LOCAL_LANG
Data type
string
Description
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>
}
}
Default
_CSS_DEFAULT_STYLE¶
Property
_CSS_DEFAULT_STYLE
Data type
string
Description
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; }
)
}
Default
FAQ¶
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).
TypoScript Examples:¶
((generated))¶
Insert a news LATEST element in the left column, so that it is visible on all pages:¶
### 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
Render news-articles with graphical header in SINGLE view:¶
### 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
}
}
}
The Category-Selector¶
[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 />
}
}
Default news id¶
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.
LIST and SINGLE at the same page¶
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
How to get rid of the <p class="bodytext"> wrap ?¶
Add one of the following lines to your TS-Setup field:
# this will remove the complete <p> tag from all news content elements
plugin.tt_news {
general_stdWrap {
parseFunc.nonTypoTagStdWrap.encapsLines.nonWrappedTag >
}
}
# this will remove the complete <p> tag from ALL content elements
lib.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¶
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.
newsMoreLink¶
Name
newsMoreLink
Description
This register is filled with the html-string for the more-link
example:
<a href="single/article/roeta-aula-dum/">more</a>
newsCategoryUid¶
Name
newsCategoryUid
Description
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¶
Name
newsKeywords
Description
This register is filled with the value of the field “Keywords”.
newsSubheader¶
Name
newsSubheader
Description
This register is filled with the value of the field “Subheader” (short).
((generated))¶
Alternative ”more”-Link¶
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>
}
Conditional ”more”-Link¶
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
}
Different wraps by category¶
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;}
Adding dynamic Metatags in SINGLE view¶
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
}
}
RealUrl and SimulateStaticDocuments¶
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.txtCopy 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 1 st 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:
LIST/LATEST¶
code
LIST/LATEST
useHRDatesSingle
useHRDatesSingleWithoutDay
AMENU¶
code
AMENU
useHRDatesSingle
useHRDatesSingleWithoutDay
SINGLE¶
code
SINGLE
useHRDatesSingle
http://www.example.com/news/view/2005/04/12/this-is-awesome/
useHRDatesSingleWithoutDay
("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):
((generated))¶
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
Date and Time formats¶
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”).
((generated))¶
Examples:¶
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]
Multilanguage News¶
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.
Sys_language_mode¶
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
Example:¶
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.
XML feeds 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:
((Unknown Property))¶
a
rss091
rss091
rss2
rss2
rdf
rdf
atom03
atom03
atom1
atom1
xmlTitle¶
a
xmlTitle
rss091
r
rss2
r
rdf
r
atom03
r
atom1
r
xmlLink¶
a
xmlLink
rss091
r
rss2
r
rdf
r
atom03
r
atom1
o
xmlDesc¶
a
xmlDesc
rss091
r
rss2
r
rdf
r
atom03
o
atom1
o
xmlLang¶
a
xmlLang
rss091
r
rss2
o
rdf
n/a
atom03
o (recommended)
atom1
n/a
xmlIcon¶
a
xmlIcon
rss091
r
rss2
o
rdf
o (must be 88x31px)
atom03
n/a
atom1
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 following
rdffeed = PAGE
rdffeed < xmlnews
rdffeed {
10.displayXML.xmlFormat = rdf
10.displayXML.xmlIcon = fileadmin/feed_icon_88x31.gif
typeNum = 101
}
## To get an additional Atom 0.3 feed add the following
atom03feed = PAGE
atom03feed < xmlnews
atom03feed {
10.displayXML.xmlFormat = atom03
typeNum = 102
}
## To get an additional Atom 1.0 feed add the following
atom1feed = PAGE
atom1feed < xmlnews
atom1feed {
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/
Extending tt_news¶
There are several possibilities to extend/change the functionality of tt_news without building a new extension (see list below). If you need additional fields in the BE-Form, you can create an extension with the kickstarter, that adds the new fields to the tt_news database-table. After this, take a look to the file EXT:tt_news/res/example_itemMarkerArrayFunc.php for an example, how to display the contents of an additional field with a userdefined marker.
You can also have a look at the extensions “news_author_rel” and “news_dam_con” which show how to extend tt_news by a field. “news_author_rel” offers also a single view for related records.
Another code example for using the hook in function getItemMarkerArray() can be found in the extension chcnewscon . So there should be enough “sources” to copy & paste your own “news_special_extended” extension.
Good Luck ;-)Here the list of the userfunctions:
- “newsAmenuUserFunc”: for processing the archive menu -> see example in folder res/
- “itemMarkerArrayFunc”: for processing the complete marker array -> see example in folder res/
- “imageMarkerFunc”: gives you the possibility to process the image markers by a user function. This userfunction works a bit different from the others: if it is enabled, the images are only processed by the userfunction not by both functions. (this could already be done by the “itemMarkerArrayFunc” but this would process the same images two times) Added an new example script: “res/example_imageMarkerFunc.php” that uses the new userfunction to add different wraps to the images in single view (see comments in file for needed TS-settings) -> see example in folder res/
- “userPageBrowserFunc”: With this userfunction you can substitute the build-in pagebrowser from tt_news with your own script. See file: “res/example_userPageBrowserFunc.php”.With the two example- pagebrowsers from this file it is possible, to use html-code like images for the “next” and “previous” links.
- you can define different template parts with: “altMainMarkers” -> see example in “Reference”.
There are many function-“hooks” in the tt_news extension:
- you can add extra-codes to the FF sheets with the function from “class.tx_ttnews_itemsProcFunc.php”: This function is called from the flexform xml files by using “tx_ttnews_itemsProcFunc->user_insertExtraCodes”this adds the “codes” to the “What to display” selectbox, that are found in the array: $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['tt_news']['what_to_display'].
- Hook for processing the extra codes in function main_news() (extraCodesProcessor).
- Hook for processing extra markers for each news record in function getItemMarkerArray() (extraItemMarkerProcessor) .
- Hook for processing the selectConf-array in function getSelectConf() (processSelectConfHook).
- Hook for processing extra markers for the complete output in function displayList() (extraGlobalMarkerHook) .
- Hook for adding a userdefined category menu (catmenu) in function displayCatmenu() (userDisplayCatmenuHook) .
- Hook to add fields to search form in function displayList() (additionalFormSearchFields)
- Hook to post-process search condition in function searchWhere() (searchWhere)
For more information about hooks see: TYPO3 Core APIs / The concept of "hooks" and: http://typo3.org/development/articles/how-to-use-existing-hooks/
List of tt_news add-ons¶
Disclaimer: this chapter provides a list of extensions that contribute additional functionality to tt_news. This list is not guarantied to be complete but best efforts are made to keep it up to date. Inclusion to this list does not mean any preference, quality assessment or recommendation. This list is only for your information and convenience. tt_news developers generally have no relation to these plugins and cannot answer questions about these plugins. The information in this list is compiled from TER.
tt_news most popular¶
Extension title
tt_news most popular
Extension key
nc_ttnews_mostpopular
Description
Adds an option to tt_news to display most read news
SmoothGallery for TYPO3¶
Extension title
SmoothGallery for TYPO3
Extension key
rgsmoothgallery
Description
Display tt_news images in a nice photogallery
Import an RSS feed into tt_news¶
Extension title
Import an RSS feed into tt_news
Extension key
xml_ttnews_import
Description
This extension imports contents from an RSS feed into distinct tt_news records. Auto import is also possible.
ttnews_feeder¶
Extension title
ttnews_feeder
Extension key
ttnews_feeder
Description
Fill tt_news with news from other web sites, which do not support RSS export
NewsPlus¶
Extension title
NewsPlus
Extension key
sg_newsplus
Description
Extends tt_news with FE-User-Editing and Layout-Selection
Flash files in News articles¶
Extension title
Flash files in News articles
Extension key
ah_flashinnews
Description
Insert Flash files into tt_news articles
DAM News¶
Extension title
DAM News
Extension key
dam_ttnews
Description
Adds DAM support to tt_news
News Calendar¶
Extension title
News Calendar
Extension key
newscalendar
Description
News Calendar for EXT:tt_news. This extension provides a calendar view for tt_news extension. It also provides a list view that works together with the calendar.
Commenting system¶
Extension title
Commenting system
Extension key
comments
Description
Can be used to comment on tt_news items in FE
Sponsoring tt_news development¶
If you want to donate money, sponsor the development of tt_news or want to hire me as freelancer for a TYPO3 project, feel free to contact me: (Rupert Germann, rupi(at)gmx.li).
Donations can also be made directly at sourceforge.net (http://sourceforge.net/donate/index.php?user_id=1067864) where tt_news CVS project is hosted.
Or take a look at my amazon wishlist: http://www.amazon.de/gp/registry/1JS3I9WKKEG31
Known problems¶
- “direct preview” with the save&preview button doesn't work in editforms of non-public versions of news articles -> use normal “version preview” instead.
- “direct preview” works only in the “Live” workspace.
If you find problems, that are not listed here, please post them at the bugtracker ( http://bugs.typo3.org ) project tx_ttnews or in the tt_news newsgroup (news://news.netfielders.de/typo3.projects.tt-news )
To-Do¶
If you have a feature request. please post it at the bugtracker ( http://bugs.typo3.org ).
Changelog¶
See: http://forge.typo3.org/repositories/entry/extension- tt_news/trunk/ChangeLog
EXT: news - 73