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.

TypoScript

This page is divided into the following sections which are all configurable by using TypoScript:

Plugin settings

This section covers all settings, which can be defined in the plugin itself. To improve the usability, only those settings are shown which are needed by the chosen view (The setting orderBy is for example not needed in the single view).

Important

Every setting can also be defined by TypoScript. However, please inform yourself about the setting overrideFlexformSettingsIfEmpty.

Properties

Property Title Sheet Type
orderBy Sort by General string
orderDirection Sort direction General string
dateField Date field to use General string
categories Category selection General string
categoryConjunction Category mode General string
includeSubCategories Include subcategories General boolean
archiveRestriction Archive General string
timeRestriction Time limit (LOW) General string
timeRestrictionHigh Time limit (HIGH): General string
topNewsRestriction Top News General string
singleNews Show a single news record General string
previewHiddenRecords Allow preview of hidden records General string
startingpoint Startingpoint General string
recursive Recursive General int
detailPid PageId for single news display additional int
listPid PageId for list display additional int
backPid PageId to return to additional int
limit Max records displayed additional int
offset Starting with given news record additional int
tags Tags additional string
hidePagination Hide the pagination additional boolean
list.paginate.itemsPerPage Items per Page additional int
topNewsFirst Sort “Top news” before additional boolean
excludeAlreadyDisplayedNews Exclude already displayed news additional boolean
disableOverrideDemand Disable override demand additional boolean
media.maxWidth Max width for media elements template int
media.maxHeight Max height for media elements template int
cropMaxCharacters Length of teaser (in chars) template int
templateLayout Template Layout template string

orderBy

Property

orderBy

Data type

string

Description

Define the sorting of displayed news records. The chapter “Extend news > Extend flexforms” shows how the select box can be extended.

orderDirection

Property

orderDirection

Data type

string

Description

Define the sorting direction which can either be “asc” for ascending or “desc” descending. This can be either asc or desc.

plugin.tx_news.settings.orderDirection = asc

dateField

Property

dateField

Data type

string

Description

The date menu builds a menu by year and month and the given news records. The menu can either be built by using the date field or the archive field.

categories

Property

categories

Data type

string

Description

Define the news categories which are taken into account when getting the correct news records.

plugin.tx_news.settings.categories = 1,2,3

Caution

Don’t forget to set the category mode too! See property below.

categoryConjunction

Property

categoryConjunction

Data type

string

Description

The category mode defines who selected categories are checked. 5 options are available:

1) Don’t care, show all

There is no restriction based on categories, even if categories are defined.

2) Show items with selected categories (OR)

All news records which belong to at least one of the selected categories are shown.

3) Show items with selected categories (AND)

All news records which belong to all selected categories are shown.

4) Do NOT show items with selected categories (OR)

This is the negation of #2. All news records which don’t belong to any of the selected categories are shown.

5) Do NOT show items with selected categories (AND)

This is the negation of #3. All news records which don’t belong to all selected categories are shown.

plugin.tx_news.settings.categoryConjunction = or

includeSubCategories

Property

includeSubCategories

Data type

boolean

Description

Include subcategories in the category selection

plugin.tx_news.settings.includeSubCategories =1

archiveRestriction

Property

archiveRestriction

Data type

string

Description

plugin.tx_news.settings.archiveRestriction = active

News records can hold an optional archive date. 2 modes are available:

active: Only active (non archived)

All news records with an archive date before the current date are shown.

archived: Archived

All news records with an archive date in the past are shown.

Hint

Records with no archive date aren’t shown in any of the selected modes.

timeRestriction

Property

timeRestriction

Data type

string

Description

plugin.tx_news.settings.timeRestriction =-1 week

The time limit offers 2 different options.

Time in seconds

Only news records with a maximum age (compared to the “Date & Time” field) are shown.

Example: An input like “86400” shows only news records which are one day (60 seconds * 60 minutes * 24 hours) old.

Time in words

It is also possible to define the maximum age in words. Examples are:

  • -3 days
  • last Monday
  • -10 months 3 days 2 hours

Words need to be in English and are translated by using strtotime .

timeRestrictionHigh

Property

timeRestrictionHigh

Data type

string

Description

See timeRestriction above. The configuration is the same but for the higher time end.

topNewsRestriction

Property

topNewsRestriction

Data type

int

Description

plugin.tx_news.settings.topNewsRestriction =2

Any news record can be set as “Top News”. Therefore it is possible to show news records depending on this flag.

1: Only Top News records

Only news records which the checkbox set are shown.

2: Except Top News records

Only news records which don’t have the checkbox set are shown.

singleNews

Property

singleNews

Data type

int

Description

plugin.tx_news.settings.singleNews =789

It is possible to show a specific news record in the Detail view if the uid is set with this property.

previewHiddenRecords

Property

previewHiddenRecords

Data type

int

Description

plugin.tx_news.settings.previewHiddenRecords = 1

If set, also records which are normally hidden are displayed. This is especially helpful when using a detail view as preview mode for editors.

Note

Be aware to secure the page (e.g. using a TS condition to make it available only if an BE user is logged in) as this page could be called by anyone using any news record uid to see its content.

Note

If set, any hidden records on the current page are shown as well!

startingpoint

Property

startingpoint

Data type

string

Description

plugin.tx_news.settings.startingpoint =12,345

If a startingpoint is set, all news records which are saved on one of the selected pages are shown, otherwise news of all pages are shown.

recursive

Property

recursive

Data type

int

Description

plugin.tx_news.settings.recursive = 2

The search for pages as startingpoint can be extended by setting a recursive level.

detailPid

Property

detailPid

Data type

int

Description

plugin.tx_news.settings.detailPid =12

This page is uses as target for the detail view. If nothing set, the current page is used.

Hint

Be aware that this setting might not be used, depending on the setting detailPidDetermination.

listPid

Property

listPid

Data type

int

Description

plugin.tx_news.settings.listPid =12

This page is uses as target for the listings, e.g. the date menu and the Search form.

backPid

Property

backPid

Data type

int

Description

plugin.tx_news.settings.backPid =12

Define a page for the detail view to return to. This is typically the page on which the list view can be found.

limit

Property

limit

Data type

int

Description

plugin.tx_news.settings.limit =10

Define the maximum records shown.

offset

Property

offset

Data type

int

Description

plugin.tx_news.settings.offset =3

Define the offset. If set to e.g. 2, the first 2 records are not shown. This is especially useful in combination with multiple plugins on the same page and the setting “Max records displayed”.

tags

Property

tags

Data type

string

Description

Add a constraint to the given tags

hidePagination

Property

hidePagination

Data type

boolean

Description

If defined, the pagination is not shown.

list.paginate.itemsPerPage

Property

list.paginate.itemsPerPage

Data type

int

Description

Define the amount of news items shown per page in the pagination.

topNewsFirst

Property

topNewsFirst

Data type

boolean

Description

plugin.tx_news.settings.topNewsFirst =1

If set, news records with the checkbox “Top News” are shown before the others, no matter which sorting configuration is used.

excludeAlreadyDisplayedNews

Property

excludeAlreadyDisplayedNews

Data type

boolean

Description

plugin.tx_news.settings.excludeAlreadyDisplayedNews =1

If checked, news items which are already rendered are excluded in the current plugin. To exclude news items, the viewHelper <n:excludeDisplayedNews newsItem=”{newsItem}” /> needs to be added to the template. .. note:: The order of rendering in the frontend is essential as the information which news record is shown and should not be included anymore is fetched during runtime.

disableOverrideDemand

Property

disableOverrideDemand

Data type

boolean

Description

plugin.tx_news.settings.disableOverrideDemand =1

If set, the settings of the plugin can’t be overridden by arguments in the URL. The override is used, e.g. to show only news of a given category (category given in the URL).

media.maxWidth

Property

media.maxWidth

Data type

int

Description

Maximum width of assets

media.maxHeight

Property

media.maxHeight

Data type

int

Description

Maximum height of assets

cropMaxCharacters

Property

cropMaxCharacters

Data type

int

Description

plugin.tx_news.settings.cropMaxCharacters =100

Define the maximum length of the teaser text before it is cropped.

templateLayout

Property

templateLayout

Data type

string

Description

plugin.tx_news.settings.templateLayout = 123

Select different layouts. See this section how to add layouts.

Note

Template variants need to be supported by the templates, otherwise this setting doesn’t change anything!

General settings

Any setting needs to be prefixed with plugin.tx_news.settings..

Properties

cssFile

Property

cssFile

Data type

string

Description

Description of the property

Default

Default value (if any). Leave out entirely if not defined.

Path to the css file. This is included with the Layouts.

format

Property

format

Data type

string

Description

Set a different format for the output. Use e.g. “xml” for RSS feeds.

Default

html

useStdWrap

Property

useStdWrap

Data type

string

Description

Add all TypoScript properties as a comma separated list which need support for stdWrap.

As an example:

settings {
  useStdWrap = singleNews

  singleNews.stdWrap.cObject = CONTENT
  singleNews.stdWrap.cObject {
       ...
  }
}

Default

html

overrideFlexformSettingsIfEmpty

Property

overrideFlexformSettingsIfEmpty

Data type

string

Description

The default behaviour of extbase is to override settings from TypoScript by the one of the flexforms. This is even valid if the setting is left empty in the flexforms.

Therefore you can define those settings which’s value should be taken from TypoScript if nothing is set in the plugin.

Default

cropMaxCharacters,dateField,timeRestriction,orderBy,orderDirection,backPid,listPid,startingpoint,recursive,list.paginate.itemsPerPage,list.paginate.templatePath

displayDummyIfNoMedia

Property

displayDummyIfNoMedia

Data type

boolean

Description

If set and no preview image is defined, a placeholder image is shown. The placeholder itself is defined with TypoScript

plugin.tx_news.settings.list.media.dummyImage = typo3conf/ext/news/Resources/Public/Images/dummy-preview-image.png

Default

1

detailPidDetermination

Property

detailPidDetermination

Data type

string

Description

This settings defines which page is used for the link to the detail view. 3 possible options are available which processed in the given order until a page has been found.

  • flexform
  • categories
  • default

flexform

This type tries to get the detail page from the plugin’s setting PageId for single news display which can also be set by using TypoScript.

# If set via TypoScript, also add detailPid to the setting "overrideFlexformSettingsIfEmpty"
plugin.tx_news.settings.detailPid = 123

categories

A detail page can also be defined for every category. Use the field Single-view page for news from this category for that

default

This type tries to get the value from the setting defaultDetailPid.

plugin.tx_news.settings.defaultDetailPid = 456

Default

flexform, categories, default

defaultDetailPid

See above

hideIdList

Property

hideIdList

Data type

string

Description

Define a list of ids of news articles which are excluded in the view. This is similar to the setting excludeAlreadyDisplayedNews but the exclusion is defined in TypoScript instead of the template.

As an example this excludes the news record of a detail action of the same page

plugin.tx_news.settings {
    useStdWrap := addToList(hideIdList)
    hideIdList.cObject = TEXT
    hideIdList.cObject {
        data = GP:tx_news_pi1|news
    }
}

orderByAllowed

Property

orderByAllowed

Data type

string

Description

Due to restrictions of extbase itself it is required to define all fields which are allowed for sorting results.

Default

sorting,author,uid,title,teaser,author,tstamp,crdate,datetime,categories.title

analytics.social

Property

analytics.social

Data type

array

Description

Use additional code for google analytics tracking of the social functionalities.

Default

analytics.social {
     facebookLike = 1
     facebookShare = 1
     twitter = 1
}

demandClass

Property

demandClass

Data type

string

Description

Overload the demand object which is used to build the queries.

Note

This is just important if you want to extend EXT:news.

facebookLocale

Property

facebookLocale

Data type

string

Description

Facebook locale which is used to translate facebook texts. Examples are de_DE, fr_FR, …

Default

en_US

disqusLocale

Property

disqusLocale

Data type

string

Description

Locale used for disqus

Default

en

googlePlusLocale

Property

googlePlusLocale

Data type

string

Description

Locale used for google+

Default

en

opengraph

Property

interfaces

Data type

array

Description

Additional open graph properties can be defined using TypoScript. Those are included in the the template partial EXT:news/Resources/Private/Partials/Detail/Opengraph.html.

The most important properties are filled automatically:

  • og:title is filled with the field Alternative title or if that is empty with the Title.
  • og:description is filled with the field Description or if that is empty with the Teaser.
  • og:image is filled with the first preview image.
  • og:url is filled with the current url.

Check out https://dev.twitter.com/cards/getting-started for more information regarding the twitter cards.

Default

     opengraph {
site_name =  {$plugin.tx_news.opengraph.site_name}
type = article
admins =
email =
phone_number =
fax_number =
latitude =
longitude =
street-address =
locality =
region =
postal-code =
country-name =
twitter {
  card = {$plugin.tx_news.opengraph.twitter.card}
  site = {$plugin.tx_news.opengraph.twitter.site}
  creator = {$plugin.tx_news.opengraph.twitter.creator}
}
     }

detail.media

Property

detail.media

Data type

array

Description

Configuration for media elements in the detail view.

Attention

If you need different options like using width instead of maxWidth you need also to adopt the template files!

Default

detail.media {
     image {
             maxWidth = 282
             maxHeight =

     # If using fluid_styled_content
     lightbox {
         enabled = {$styles.content.textmedia.linkWrap.lightboxEnabled}
         class = {$styles.content.textmedia.linkWrap.lightboxCssClass}
         width = {$styles.content.textmedia.linkWrap.width}
         height = {$styles.content.textmedia.linkWrap.height}
     }
     # If using css_styled_content, use those ssettings
     # lightbox {
     #      enabled = {$styles.content.imgtext.linkWrap.lightboxEnabled}
     #      class = {$styles.content.imgtext.linkWrap.lightboxCssClass}
     #      width = {$styles.content.imgtext.linkWrap.width}
     #      height = {$styles.content.imgtext.linkWrap.height}
     #      rel = lightbox[myImageSet]
     # }
     }

     video {
             width = 282
             height = 300
     }
}

detail.errorHandling

Property

detail.errorHandling

Data type

string

Description

If no news entry is found, it is possible to use various types of error handling.

  • showStandaloneTemplate: A template is rendered. The syntax is showStandaloneTemplate,<path>,<errorCode>, e.g. `showStandaloneTemplate,EXT:news/Resources/Private/Templates/News/DetailNotFound.html,404
  • redirectToListView: This will redirect to the list view on the same page.
  • redirectToPage: Redirect to any page by using the syntax redirectToPage,<pageid>,<status>. This means e.g. redirectToPage,123,404 to redirect to the page with UID 123 and error code 404.
  • pageNotFoundHandler: The default page not found handler will be called.

Default

showStandaloneTemplate

detail.checkPidOfNewsRecord

Property

detail.checkPidOfNewsRecord

Data type

boolean

Description

If set, the detail view checks the incoming news record against the defined starting point(s). If those don’t match, the news record won’t be displayed.

Default

0

detail.showMetaTags

Property

detail.showMetaTags

Data type

boolean

Description

If enabled, the meta tags including title, description and various open graph tags are rendered

Default

1

detail.showPrevNext

Property

detail.showPrevNext

Data type

boolean

Description

If enabled, links to the previous and next news records are shown

Default

0

detail.registerProperties

Property

detail.registerProperties

Data type

string

Description

Define a list of properties you want to be able to use via the TypoScript option register.

lib.fo = TEXT
lib.fo {
        # title becomes newsTitle, keywords becomes newsKeywords, ...
        data = newsTitle
}

Default

keywords,title

detail.showSocialShareButtons

Property

detail.showSocialShareButtons

Data type

boolean

Description

If set, the social share functionality is shown. This includes facebook, twitter, google+

Default

1

detail.disqusShortname

Property

detail.disqusShortname

Data type

string

Description

If set, the commenting system of disqus (www.disqus.com) is used with the given name.

list.media

Property

list.media

Data type

array

Description

Configuration for media elements in the list view.

Attention

If you need different options like using width instead of maxWidth you need also to adopt the template files!

Default

     list.media {
image {
     maxWidth = 100
     maxHeight = 100
}
     }

list.paginate

Property

list.paginate

Data type

array

Description

EXT:news uses a custom ViewHelper to render the pagination.

The following settings are available:

itemsPerPage

Define how many items are shown on one page.

insertAbove

Set it to TRUE or FALSE to either show or hide the pagination before the actual news items.

insertBelow

Set it to TRUE or FALSE to either show or hide the pagination after the actual news items.

maximumNumberOfLinks

If set, not all pages of the pagination are shown but only the given amount. Imagine 1000 news records and 10 items per page. This would result in 100 links in the frontend.

prevNextHeaderTags

Add additional header tags <link rel=”prev” href”” /> and <link rel=”next” href”” /> to tell google about the pagination. Read more at http://googlewebmastercentral.blogspot.co.at/2011/09/pagination-with-relnext-and-relprev.html

templatePath

Set a custom template file for the paginate widget. The path has to point to the template file, for example EXT:foobar/Resources/Private/Templates/ViewHelpers/Widget/Paginate/Index.html

Important

list.paginate.templatePath needs to be added to the setting overrideFlexformSettingsIfEmpty!

Default

     list.paginate {
itemsPerPage = 10
insertAbove = 1
insertBelow = 1
templatePath =
prevNextHeaderTags = 1
maximumNumberOfLinks = 3
     }

list.rss

Property

list.rss

Data type

array

Description

Additional settings for the RSS view

See the RSS configuration

Default

     rss {
channel {
     title = {$plugin.tx_news.rss.channel.title}
     description = {$plugin.tx_news.rss.channel.description}
     language = {$plugin.tx_news.rss.channel.language}
     copyright = {$plugin.tx_news.rss.channel.copyright}
     generator = {$plugin.tx_news.rss.channel.generator}
     link = {$plugin.tx_news.rss.channel.link}
}
     }

search.fields

Property

search.fields

Data type

string

Description

Comma separated list of fields which are used for the search.

Hint

You can also search in relations, e.g. the category title by using categories.title

Default

teaser,title,bodytext

search.splitSearchWord

Property

search.splitSearchWord

Data type

boolean

Description

If set to 1, the search subject will be splitted by spaces and it will not only find the phrase but also if the search terms are scattered in a field.

As an example: Searching for hello world will give you as result also the news item with the title hello the world. The search terms must be found in the same field, which means that a news item with the world hello in the title and the word world in the bodytext won’t be found.

If you need a better search experience, think about using something like EXT:solr!

Default

0