WARNING !! Do not install this tt_news version on TYPO3 prior to version 3.8.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!
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 “How to update”.
Important: Deactivate all extensions that depend on a prior version of tt_news (<1.4.0)
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).
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”.
“Dividers to Tabs” is a feature introduced with TYPO3 3.7.0 which divides the BE form of a news record to smaller parts (“Tabs”) see screenshot in the section “Screenshots”. Here you can disable this if you don't want to use it.
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 mode for text fieldsBy 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 imagesThe 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 localizationsBy 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").
Category ordering in BackEnd treesHere you can configure the the ordering of categories in the category tree in BackEnd forms.
Width of the left category fieldThis 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 fieldThis 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.
Max height for category trees Here you can configure the maximum height of category trees in BackEnd forms. If you have xajax enabled for the expandable category tree, set this value to 30 because the height of the tree field will then be adapted to the tree height automatically.
If you upgrade your tt_news extension from a prior version (< 1.2.x), its required to use the “UPDATE!” function to synchronize table data.
The Updater does two things:
it transfers the content of the field “CODE” (e.g. LIST//1) from the old content element to the new flexform based parts of the content element
it creates relations to the categories in a new relation table (tt_news_cat_mm).
To perform this action, open the extension manager and click on the tt_news extension:
then click on the dropdown menu in the upper right corner and choose "UPDATE!"
If you don't see the option named "UPDATE!" the updater didn't find anything to update.
The update script will inform you about what it is going to do by showing the number of items found to be updated.
Note: This action will not change your old data in the tt_news or tt_content table. So even if you perform this action, you will still be able to downgrade to an earlier version of tt_news retaining the old category relations and CODE field data.
Just click the "DO IT" button to perform the update.
Q: can this update-script update the tables and fields of any version of tt_news to the current one?A: No. First thing to know: from which version of tt_news do you upgrade to the current version?
case 1: If you upgrade from the "classic" 1.0.4 version without any other news-extension installed, you can use the updater and all should be ok. :-)
case 2: if you upgrade from a tt_news version 1.0.x with one of the news-extensions installed that provides the "multiple categories"-feature, the updater will only update the content elements to flexforms but won't touch the category relation-table because its already present.
case 3: if you upgrade your tt_news extension from a version higher than 1.2.0 the updater will find data in the flexforms fields and also a category relation table. In this case the option "UPDATE!" won't appear in the extension manager.
Q: after updating my tt_news version (< 1.2.0) to the new tt_news version I don't see my old settings in the fields "Starting point" & "recursive". Is this a bug in the updater?A: No. Your old settings are still present and they work. If you set a new "Starting Point" in the Flexform field, this value will have priority over the old "invisible" value.
Q: I upgraded my tt_news version 1.0.x to the current version and don't see the “UPDATE!” option in the dropdown menu in the extension manager. A: This happens, a) if you look in this menu directly after clicking the “Click here to install the extension” link in EM. Reload the page or choose any other option from the function-menu, and then look again in the menu.or b) if there is any data found in the table “tt_news_cat_mm”. This is the case, if you had an extension installed, that adds this table to tt_news 1.0.x (f.e. “News multiple categories” ext-key: dkd_newsmulticats).
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.
*** Important Note ***There is one major change between tt_news 2.x and older tt_news versions: In tt_news 2.x the default TS-template is not included automatically. That means, if you don't include the TS-template as shown in the screenshot below, the plugin will do nothing.
The TS-settings are splitted in 4 different parts now which you should be included with the “Include static (from extensions)” feature. The big advantage of this technique is, that the extension is not included in all TypoScript setups from your site by default. You can now choose if you want to include only the basic setup or to include the CSS-based setup, the default CSS-Styles and the RSS-feed feature.
For the first test, open your main TS-template (in list view), scroll down to the “Include static (from extensions)”-section and 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.
table-based tmpl: This are the settings for the table-based tt_news template (with global wraps, global colors and <font> tags) including this template together with the css-based templates will work but it will not make much sense.
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.
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.
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.
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.
What to display:
Currently there are 7 different options in the “What to display” field (this list can be extended by other extensions). These are the function of this options:
FIELD: What to display | Description: |
|---|---|
LIST | Displays a list of news. |
LATEST | List the latest news. By default this is not just another “LIST” template. It lists only non-archived new-records, and it is not influenced by the archive menu selection. (This behaviour can be changed by setting “displayArchivedInLatest” to 1 -> then LATEST will act like a normal LIST) |
AMENU | Displays a menu of the archive divided into time periods. See section “The Archive”. |
SINGLE | Displays a single news item. See section “The SINGLE view”. |
SEARCH | Displays a search box and result listing for searching news. See section “The Search”. |
CATMENU | Displays a category selector which shows nested categories in a hierarchical menu. See section “The category selector”. |
VERSION_PREVIEW | Displays the version preview for news articles. Basically it does the same as the SINGLE view but it displays only something when a version preview was requested.This option appears only when the extension “version” is installed. see section “version preview” for mor information. |
It is possible to define multiple “What to display”-codes in a news content-element, but some of them will not work well together. If you encounter problems with those combined content-elements, try to split them in single elements with one code per element.
"Order by" this field (LIST & LATEST):
In this selectbox you can choose the field by which the listed news-records should be ordered. Possible options are: datetime, archivedate, author, title, type and “randomise order”.
default (= nothing selected) is to order lists by the “datetime” field and display newest items first.
With the selectbox “Ascending or Descending” you can choose the sorting order.
If you want to order or group your news by fields, not listed here, you can do this by setting those fields by TypoScript. See section “Reference“ -> “listOrderBy” and “listGroupBy”
The special case “randomise order” orders the news by random.
Hint:
If you use randomly ordered news, it is required that tt_news works as USER_INT object or caching disabled.
Add this to the TS setup of the page where you want to display rendom news:
plugin.tt_news = USER_INT
f this page is on the first level of the pagetree all pages below this page will also display tt_news as USER_INT object which consumes much more processing power than a USER object which can be cached.
This can be prevented by using the 'template on next level' feature to set tt_news again to USER.
plugin.tt_news = USER
Category selection:
The display of categories in the right field of the part “Category Selection” depends on two settings: If you didn't change the default value of the “use StoragePid” switch in the plugin-configuration in the extension manager, it is required to define a "General Record Storage page" in the page-properties of the rootpage (the page with the “is root of the website” flag).
The "General Record Storage page" points to the folder where the tt_news categories are stored. See “FAQ” for more information.
If you set the “use StoragePid” value to “0” in the extension manager, you should see all categories from the whole pagetree in the select box.
It's possible to select newsitems for display by their assigned categories or subcategories. A newsitem can be member of multiple categories. It's also possible to de-select news by their assigned categories of to display only non-categorized items. The “Category mode” selector offers the following options:
FIELD: Category mode | Description: |
|---|---|
Show all (don't care about selection below) | Displays all news no matter which categories are assigned. (Don't care about the field: Category selection) |
Show items with selected categories (OR) | Only news are displayed, which have at least one of the selected categories or subcategories assigned (FIELD: Category selection). If there are more than the selected categories assigned to the news record it will be shown also. |
Show items with selected categories (AND) | Only news are displayed, which have all of the selected categories or subcategories assigned (FIELD: Category selection) |
Do NOT show items with selected categories (AND) | News which are members of all of the selected categories or subcategories (FIELD: Category selection) will not be displayed. |
Do NOT show items with selected categories (OR) | News which are members of at least one of the selected categories or subcategories (FIELD: Category selection) will not be displayed. |
Use subcategories
With this switch you can configure if news items are also selected by their subcategories.
Archive setting (for LIST):
It is possible to give each news record an “archive date”. It is also possible to handle news-items automatically as archived, if they are older than a certain number of days. -> see: Section "The Archive” and the part “Archive Settings” in section “Reference”.(“for LIST” means, that the archive mode is only selectable for the “LIST” view. “LATEST” is by default never showing archived items -> can be changed with “displayArchivedInLatest”)
“Archive setting” gives you these options:
FIELD: Archive setting | Description: |
|---|---|
Don't Care | Show all newsi no matter if they are archived or not. |
SHOW ARCHIVED | Show only news which have reached their archive date |
SHOW NONARCHIVED | Show only news which have not reached their archive date. |
Starting point and Recursive level selection:
"Starting point" is used to tell the extension where the news records are stored. It is possible to select multiple ”Starting points”. This way, you are able to collect news from several folders to display them in one content-element.
If you don't insert a page as "Starting point", tt_news will look for a value for “pid_list” from TypoScript. This is the recommended way to configure many news content-elements from one central point, e.g. from the constants field in your main TS-template. -> see files EXT:tt_news/static/ts_new/constants.txt & EXT:tt_news/static/ts_new/setup.txt for examples. The “Starting Point” can also be set in the Constant editor.
If no value for “Starting Point” is present at all, the current page is used. (the page where you inserted the tt_news content-element).
Recursive level selection:
This tells the extension how many levels of subpages to include below the page(s) given in the "Starting point" field.
HintIf 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.
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.
HintThe best way to include your own html-template is to link it directly in TS. Add the following line by hand to your TypoScript setup or edit the default value in the “TypoScript Object Browser”:
plugin.tt_news.templateFile = fileadmin/templates/tt_news_template.html
Do not edit and save the html-template in the extension directory -> it will be overwritten if you update tt_news.
You can change the news display, by simply creating a new template-file for the display of news. There are 2 default template-files included in tt_news (in the folder EXT:tt_news/pi/):
tt_news_v2_template.html: the new css-based html-template.
news_template.tmpl: the table-based template.
The main differences between the new css based template and the “traditional” template are:
In the new template, the visual formating is moved from TypoScript to css-styles. GlobalWraps, GlobalColors and many of the Wraps (like “title_stdWrap”) are not used anymore.
TypoScript still plays a big role in configuration for processing parts of the output (f.e.:”age_stdWrap”) or for inserting all kinds of conditional wraps (see: “getRelatedCobj” for an example)
if you want to change the template, take a look at that file, make a copy of it and modify it to your own design. Observe the comments in the file - they are markers that define where content is inserted and which parts are used for this and that. Self explanatory to a certain degree...
Max Width/Height for images
These 2 fields offer you the possibility to set the image sizes for a certain content element different from the image sizes defined globally by TypoScript. The setting here will be applied to all images, displayed by this content element (works with: LIST, LATEST, SINGLE and SEARCH)
The sheet “Category settings” offers a range of options regarding how to display category-texts (titles) and category-images.
The default setting is “Use the settings from TS” which is “Display but no link” for images and texts.
FIELD: Category Image Link Mode, Category Text Link Mode | Description: |
|---|---|
Use the settings from TypoScript | You can set the options for displaying category images and texts also by TS but this values are only recognized if this option is selected. See “catImageMode” and “catTextMode” in the Constant editor. |
Don't display at all | No category images/texts will be displayed |
Display but no link | Category images/texts will be displayed but not linked |
Act as link to category shortcut | Category images/texts will be displayed and function as a link to the page given as category shortcut. |
Act as category selector | Category images/texts will be displayed and function as category selector. -> useful for filtering search results |
Other Category settings:
FIELD: | Description: |
|---|---|
Max width of category image | Maximum width of category images. If one dimension of the image is larger than the given width or height, the image is downscaled. |
Max height of category image | See above |
Max number of category images | here you can limit the number of displayed category images |
Max number of categorys texts | Same for category texts |
PageId for single news display:
This tells the extension on which page the single view is located. It's not required to set a value here, cause it's more efficient to set a global value for the single view (singlePid) in the constant-Editor of your root template. See: “Configuration”
PageId to Return to:Here you can set an alternative page for the "back to list" link in the single view. Works of course only if the current content element is SINGLE. By default the “back to List” Link in the SINGLE view points to the page where you came from. The setting here will override a globally given “backPid”.
Don't display first image in single view (firstImageIsPreview):
If you set this checkbox, the SINGLE view will not display the first image atached to the news article. The first image will only appear in LIST and LATEST view and is handled as "preview image" of the news item.(works only if more than one image is atached to the news article).
You can force this behavior even when only one image is assigned to the news record by checking the next checkbox (forceFirstImageIsPreview)
List StartId: Force LIST or LATEST to start from this item [deprecated]
with this option (and “limit”) you can realize complex combinations of news content-elements, by giving each item its own offset from the first result.
Let's assume you want to realize a page that looks like this:
the first (red) content element is configured to show one item (limit=1). The “listStartId” is empty, so it shows only the very first result.
the second (purple) content-element shows also only one item (limit=1) the “listStartId” is set to 1 (because the counting starts with zero). The image in this content element is set to a smaller size than the first content-element.
the two other content-elements (green) are both limited to show 4 items, the left one starts with “listStartId” set to 2, the other one starts with listStartId=6
(thank goes to Paolo Nugnes for sponsoring this feature)
Since tt_news 2.5.0 “listStartId” is deprecated because the new TS option “excludeAlreadyDisplayedNews” does the same without the need to configure the listStartId for each content element. If you f.i. Want to get a news layout like shown in the image above simply place 4 news plugin content elements on the page, configure the limit for each plugin and add the following line to your TS setup:
plugin.tt_news.excludeAlreadyDisplayedNews = 1
If "excludeAlreadyDisplayedNews" is enabled "excludeLatestFromList" and "listStartId" will be ignored.
Limit: max items in LIST and LATEST
here you can set a limit only for this content-element. A value from this field will override the limits configured by TypoScript.
Don't display Pagebrowser
as the name says.
Insert pagebreak in SINGLE after this number of words
If you want to override the globally configured value for “maxWordsInSingleVIew” in the current content-element, you can insert the new value here. For more information see section “Pagebreaks” in this manual.
Field descriptions:
Here you can define the type of the newsitem. The different types are shown with different icons in the BackEnd. Possible types are:
| News | This type is used for normal news articles. Only these news will have a link to a single view. |
|---|---|---|
| Link External page | 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”. |
| Link internal page | 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) |
If this “editlock” is enabled non-admin users can't open this record. All other actions (hide,copy,delete,....) are also disabled.
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.
The value of this field affects several things:
The news in lists and in 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.
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.
This field appears only in translated news records and points to the translation Original. (The translation original has to be in the default 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.
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.
The versioning label of this record. This field is only visible when the extension "versioning" (extkey version) is installed.
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.
This is the main text of the news article and will substite the html-template marker ###NEWS_CONTENT###.
this will disable automatic pagebreaks after a certain amount of words for this record.
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###).
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.
Here you can define images that will be shown in the news item. All images will be rendered to the marker ###NEWS_IMAGE###.
Field for the imagecaption which will be displayed under the image. If more than one image is assigned the value of this field can be splitted by linebreaks.
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.
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>
In this field you can select news records or pages that will be displayed as related news. Related news with type “news” will point to the single view of the related news record. Related news with type “External URL” or “internal Link” will point to the url or page id that is inserted in the news record. Related pages will be handled as news with type “internal link”.
Related news will substite the marker ###NEWS_RELATED###.
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 (requires the extension xajax).
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.
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 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 category manager is a BackEnd module which was introduced in tt_news version 2.5.0 (TYPO3 4.0 or higher required). It is located under Web->Info and offers a handy way to manage complex category trees. In this module you see the categories in a tree view which can be expanded and collapsed. Moving and copying of categories can be done by drag&drop. It's also possible to edit, hide and delete category records. If a category is deleted all subcategories of this record will be deleted, too.
The category db-record looks like this:
Field descriptions:
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
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.
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.
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 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.
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)
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.
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:Category description as tooltip in the category select field:
By choosing the code CATMENU in the tt_news content element or by TS a category selector will be displayed which shows nested categories in a hierarchical menu.
The catmenu can work in 2 different modes:
tree (default): The category menu will be rendered like the categories in BE fields. The shown “tree” is build by images and can show userdefinded icons.
nestedWraps: This mode will render a category menu where each level has its onwn wrap.
in both modes the content of the field “description” will be filled to the “alt” and “title” attributes of the catselector link so it appears as tooltip when the mouse pointer is over it. If this is not wanted it can be disabled by setting “displayCatMenu.insertDescrAsTitle” to 1.
The wraps for the complete catmenu, for the menu states (NO and ACT) and for the header of the catmenu are also used in both modes.
The CSS styles for all category menus are included in the static TS template “default CSS styles (tt_news)”. If you're using the “table based” template for tt_news you'll have to include the CSS styles manually.
The tree mode has some special options for configuring the icons. The option “catmenuIconMode” configures the behaviour of the icons showing left to the category titles. “catmenuIconMode” offers the following options:
-1 = display no icons at all
0 = display the default icon (tt_news_cat.gif)
1 = display image from category record as icon
2 = display the icon which is configured as “catmenuIconFile” (default: EXT:tt_news/res/arrow.gif)
The icon for the “root” item of the tree (the catmenu header) can be configured separately (“catmenuRootIconFile”) or completely disabled by seetting “catmenuNoRootIcon” to 1.
The sizes for the normal icons in catmenuIconMode “1” and “2” and for the root icon can be configured separately.
TypoScript setup for a “catmenu” content element that looks like this:
plugin.tt_news { displayCatMenu {# select root icon file
catmenuRootIconFile = EXT:tt_news/res/tt_news_cat.gif
# enable root icon
catmenuNoRootIcon = 0
# disable other icons
catmenuIconMode = -1
}
}
All other settings are included in the default TS templates (see Section “Reference” for details)
In this mode each level of the "catmenu" has its own wrap. 1 is the first level.
TypoScript setup for a “catmenu” in mode “nestedWraps”:
plugin.tt_news {
displayCatMenu {mode = nestedWraps
# wrap for the complete "catmenu"
catmenu_stdWrap.wrap = <div class="news-catmenu">|</div>
# wraps for active or inactive category links in the tree
catmenuItem_ACT_stdWrap.wrap = <img src="tslib/media/bullets/bullet1_h.gif" />|
catmenuItem_NO_stdWrap.wrap = <img src="tslib/media/bullets/bullet1_n.gif" />|
# wrap for level "n"
catmenuLevel1_stdWrap.wrap = <div class="level1">|</div>
catmenuLevel2_stdWrap.wrap = <div class="level2">|</div>
catmenuLevel3_stdWrap.wrap = <div class="level3">|</div>
catmenuLevel4_stdWrap.wrap = <div class="level4">|</div>
}
}
After adding the CSS styles below to your website the catmenu could look like this:
CSS Styles:
.news-catmenu {
padding:5px 0px 0px 5px;
margin:10px;
border:1px solid #666;
background-color:#F9FFE5;
}
.news-catmenu DIV IMG {
margin:0px;
padding: 0px 3px 3px 0px;
vertical-align: middle;
}
Hint: With a function hook in the tt_news class (“userDisplayCatmenuHook”) It's possible to add a userdefined script that renders the “catmenu”.
The complete view of a news article (single view) has some special features that are not available in LIST or LATEST.
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 news records that are inserted in the field “Related news” in the tt_news db-record are shown in the single view. If those records are “normal news”, their links point to the single view of the related news article. Related news with type “link external URL” or “link internal page” will link directly to the url or page id that is configured in the news record.
Additionally to news records, relations can also point directly to internal pages. Related pages will be handled as news that link to internal pages.
tt_news can be configured to insert the link that points back from the related record to the current one automatically. This feature can be enabled by setting “useBidirectionalRelations” to 1.
The display of related news and pages is configured by TypoScript. For more information search for “getRelatedCObject” in the section reference of this manual. The details of the link configuration can be found in the section “Link Configuration”.
The single view can also be configured to show a list of news articles with the same category as the current article. The feature is disabled by default and can be enabled by setting “showRelatedNewsByCategory=1”.
If news with the same category are found, they will be rendered as news LIST to the marker “###NEWS_RELATEDBYCATEGORY###”. The header will be rendered to the marker “###TEXT_RELATEDBYCATEGORY###”.
By default the code LIST causes tt_news to render the content to the template ###TEMPLATE_LIST### This can be changed with “altMainMarkers” to take an userdefined template instead which f.e contains only the news titles. The template for “related news by category” is included in the file tt_news_v2_template.html -> part: “###TEMPLATE_CAT_RELATED###”
Add the following lines to the setup field of an +ext (TS) template which is located in the page with the SINGLE view content element. Then “related news by category” should look like the screenshot above.
plugin.tt_news {
# wrap for all related news by category
relatedByCategory_stdWrap.wrap = <dl class="news-single-related">|</dl>
# wrap for the header
relatedByCategoryHeader_stdWrap.wrap = <dt>|</dt>
# globalwrap 3 is used to wrap the list items
wrap3.wrap = <dd>|</dd>
# change the name for template LIST to TEMPLATE_CAT_RELATED
altMainMarkers.TEMPLATE_LIST = TEMPLATE_CAT_RELATED
altMainMarkers.TEMPLATE_LIST.wrap = ### | ###
}
Hint:
If you have more than one SINGLE view in your website you can use the TypoScript condition below for changing the template part with “altMainMarkers” - It's not needed to add an +ext template to each SINGLE view page.
# this changes the template part for list only if a SINGLE view was requested
[globalVar = GP:tx_ttnews|tt_news > 0]
plugin.tt_news {altMainMarkers.TEMPLATE_LIST = TEMPLATE_CAT_RELATED
altMainMarkers.TEMPLATE_LIST.wrap = ### | ###
}
[global]
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 | DateTime: 01.11.04 (Future) | ArchiveDate: 0 (empty) |
News 2 | DateTime: 01.10.04 (Past, after DDTAStart) | ArchiveDate: 0 (empty) |
News 3 | DateTime: 15.09.04 (Past, after DDTAStart) | ArchiveDate: 30.09.04 (Past) |
News 4 | DateTime: 01.08.04 (Past, before DDTAStart) | ArchiveDate: 30.08.04 (Past) |
News 4a | DateTime: 01.08.04 (Past, before DDTAStart) | ArchiveDate: 0 (empty) |
News 5 | DateTime: 01.07.04 (Past, before DDTAStart) | ArchiveDate: 01.12.04 (Future) |
Archive Settings | |||||||
|---|---|---|---|---|---|---|---|
enable Archive Date | datetime DaysTo Archive | AMENU | LIST show archived | LATEST | LIST show NON archived | LIST don't care | |
0 | 0 | - 2 3 4 4a 5 | 1 2 3 4 4a 5 | 1 2 3 4 4a 5 | 1 2 3 4 4a 5 | 1 2 3 4 4a 5 | |
0 | 30 | - - - 4 4a 5 | - - - 4 4a 5 | 1 2 3 - - - | 1 2 3 - - - | 1 2 3 4 4a 5 | |
1 | 0 | - 2 3 4 4a - | 1 2 3 4 4a - | 1 2 - - 4a 5 | 1 2 - - 4a 5 | 1 2 3 4 4a 5 | |
1 | 30 | - - 3 4 4a - | - - 3 4 4a 5 | 1 2 - - - - | 1 2 - - - - | 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 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.
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.
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.
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”
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 not located under one pagetree, you have to set the "General Records Storage page" for each news sysfolder and the rootpage of your site: