Initial commit - Typo3 11.5.41

This commit is contained in:
Matteo Gallo
2026-07-03 17:53:31 +02:00
commit 5ca4743197
6811 changed files with 568848 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
.. include:: /Includes.rst.txt
.. _events:
.. _referenceEvents:
======
Events
======
Several events can be used to modify the behaviour of EXT:news. Check out the
:ref:`Events tutorial <eventsTutorial>` for examples on how to use them.
Available Events
================
When register to an event you can always access the class where the event is
fired. For additional items see column "Access to" in the table below.
.. todo: automatically document events
.. csv-table:: Events
:header: "Event class", "Fired in class", "Access to", "Old Signal"
"NewsCheckPidOfNewsRecordFailedInDetailActionEvent", "NewsController", "getNews()", "checkPidOfNewsRecordFailedInDetailAction"
"NewsDateMenuActionEvent", "NewsController", "getAssignedValues()", "dateMenuAction (NewsController::SIGNAL_NEWS_DATEMENU_ACTION)"
"NewsDetailActionEvent", "NewsController", "getAssignedValues()", "detailAction (NewsController::SIGNAL_NEWS_DETAIL_ACTION)"
"NewsListActionEvent", "NewsController", "getAssignedValues()", "listAction (NewsController::SIGNAL_NEWS_LIST_ACTION)"
"NewsListSelectedActionEvent", "NewsController", "getAssignedValues()", "selectedListAction (NewsController::SIGNAL_NEWS_LIST_SELECTED_ACTION)"
"NewsSearchFormActionEvent", "NewsController", "getAssignedValues()", "searchFormAction (NewsController::SIGNAL_NEWS_SEARCHFORM_ACTION)"
"NewsSearchResultActionEvent", "NewsController", "getAssignedValues()", "searchResultAction (NewsController::SIGNAL_NEWS_SEARCHRESULT_ACTION)"
"AdministrationIndexActionEvent", "AdministrationController", "getAssignedValues()", "indexAction (AdministrationController::SIGNAL_ADMINISTRATION_INDEX_ACTION)"
"AdministrationNewsPidListingActionEvent", "AdministrationController", "getRawTree();getTreeLevel()", "newsPidListingAction (AdministrationController::SIGNAL_ADMINISTRATION_NEWSPIDLISTING_ACTION)"
"AdministrationExtendMenuEvent", "AdministrationController", "getMenu()", "createMenu"
"CategoryListActionEvent", "CategoryController", "getAssignedValues()", "listAction (CategoryController::SIGNAL_CATEGORY_LIST_ACTION)"
"TagListActionEvent", "TagController", "getAssignedValues()", "listAction (TagController::SIGNAL_TAG_LIST_ACTION)"
"NewsImportPostHydrateEvent", "NewsImportService", "getImportItem();getNews()", "postHydrate"
"NewsImportPreHydrateEvent", "NewsImportService", "getImportItem()", "preHydrate"
"CategoryImportPostHydrateEvent", "CategoryImportService", "getImportItem();getCategory()", "postHydrate"

View File

@@ -0,0 +1,313 @@
.. include:: /Includes.rst.txt
.. _extensionConfiguration:
=======================
Extension Configuration
=======================
Some general settings can be configured in the Extension Configuration.
#. Go to :guilabel:`Admin Tools > Settings > Extension Configuration`
#. Choose :guilabel:`news`
The settings are divided into several tabs and described here in detail:
.. only:: html
.. contents:: Properties
:local:
:depth: 2
Records
=======
.. _extensionConfigurationArchiveDate:
Archive Date `archiveDate`
--------------------------
.. confval:: archiveDate
:type: string (keyword)
:Default: date
Define how the archive date field should be rendered:
`date`
Render the field as pure date
`datetime`
Render it as date and time field
Enable a RTE for the teaser field `rteForTeaser`
------------------------------------------------
.. confval:: rteForTeaser
:type: bool
:Default: 0
If set, the teaser field will be rendered using a RTE.
.. _extensionConfigurationTagPid:
Define pid of tag records `tagPid`
----------------------------------
.. confval:: tagPid
:type: int
:Default: 0
New tags can be saved directly inside the news record. The given ID is used
as page on which the tag records will be saved.
This setting can also be done with TSconfig, see :ref:`tagPid <tsconfigTagPid>`
If you want to use TsConfig to define the page, set the tagPid to 0 and use
the following syntax in TsConfig: ::
# Save tags on page with UID 123
tx_news.tagPid = 123
.. _extensionConfigurationPrependAtCopy:
Prepend at copy `prependAtCopy`
-------------------------------
.. confval:: prependAtCopy
:type: bool
:Default: 1
If set and a news record is copied, the news record will be prepended
with the string **Copy X**.
.. _extensionConfigurationCategoryRestriction:
Category restriction `categoryRestriction`
------------------------------------------
Category restriction: Restrict the available categories in news records.
PageTsConfig::
TCEFORM.tx_news_domain_model_news.categories.PAGE_TSCONFIG_IDLIST=120.
.. warning::
This feature is currently under development and not being expected to work!
.. _extensionConfigurationCategoryBeGroupTceFormsRestriction:
Editor needs to have permissions to all selected categories to save a news item `categoryBeGroupTceFormsRestriction`
---------------------------------------------------------------------------------------------------------------------
.. confval:: categoryBeGroupTceFormsRestriction
:type: bool
:Default: 0
If activated, an editor needs to have permissions to all categories
added to a news item to be able to edit this record.
.. _extensionConfigurationContentElementRelation:
Use content element relation `contentElementRelation`
-----------------------------------------------------
.. confval:: contentElementRelation
:type: bool
:Default: 1
If set, you can add content elements as relation to a news record.
This makes it easy to enrich the news article with further images, plugins, ...
If you want to reduce the available options of the content elements, you can
use TsConfig in the sysfolder of the news records: ::
# Hide content element types
TCEFORM.tt_content.CType.removeItems = header,bullets,table,uploads,menu,list,html,login,mailform,search,shortcut,div
# Hide fields
TCEFORM.tt_content.header.disabled = 1
TCEFORM.tt_content.header_layout.disabled = 1
More information can be found at http://docs.typo3.org/typo3cms/TSconfigReference/PageTsconfig/TCEform/Index.html.
.. _extensionConfigurationContentElementPreview:
Improved preview of content element relations `contentElementPreview`
---------------------------------------------------------------------
.. confval:: contentElementPreview
:type: bool
:Default: 1
If set, the preview in the backend is rendered as in the page module.
.. _extensionConfigurationManualSorting:
Enable manual sorting of news records `manualSorting`
-----------------------------------------------------
.. confval:: manualSorting
:type: bool
:Default: 0
If set, news records can be manually sorted in the list view by the well
known icons "up" and "down".
.. _extensionConfigurationDateTimeNotRequired:
Disable required date field `dateTimeNotRequired`
-------------------------------------------------
.. confval:: dateTimeNotRequired
:type: bool
:Default: 0
If set, the date field of the news record is not a required field anymore.
Furthermore if creating a new record, it is not filled anymore with the
current date.
Be aware that using this feature may lead to unexpected results if using
e.g. the date menu if the field is not used anymore.
.. _extensionConfigurationAdvancedMediaPreview:
Advanced preview configuration for media files `advancedMediaPreview`
----------------------------------------------------------------------
.. confval:: advancedMediaPreview
:type: bool
:Default: 1
If enabled, more options are available for editors defining where an media
element should be displayed.
.. _extensionConfigurationSlugBehaviour:
Slug behaviour `slugBehaviour`
------------------------------
.. confval:: slugBehaviour
:type: string, keyword
:Default: unique
Choose one of the following slug behaviours:
uniqueInSite
The same slug can be used for news in different sites. Use this
setting *only* if no news records are shared between sites.
unique
The same news title in different sites will lead to different slug names.
Backend Module
==============
.. _extensionConfigurationShowAdministrationModule:
Show administration module `showAdministrationModule`
-----------------------------------------------------
.. confval:: showAdministrationModule
:type: bool
:Default: 1
If set, the backend module "News" is shown. This view might be easier for
editors who use a very limited set of features in the backend.
.. _extensionConfigurationShowImporter:
.. _extensionConfigurationHidePageTreeForAdministrationModule:
Hide page tree for Administration module `hidePageTreeForAdministrationModule`
-------------------------------------------------------------------------------
.. confval:: hidePageTreeForAdministrationModule
:type: bool
:Default: 0
If set, the backend module "News" is shown without the page tree. In
combination with the TsConfig :confval:`redirectToPageOnStart` you can
achieve a very simple workflow for editors if those need only to create
news records.
Import Module
=============
Show importer `showImporter`
----------------------------
.. confval:: showImporter
:type: bool
:Default: 0
If set, the backend module "News import" is shown. This is used to
import news articles from sources like t3blog, tt_news or custom providers.
.. _extensionConfigurationStorageUidImporter:
UID of storage to use when importing files/images `storageUidImporter`
----------------------------------------------------------------------
.. confval:: storageUidImporter
:type: int
:Default: 1
Define the uid of the storage which is used for importing media elements
into FAL relations.
.. _extensionConfigurationResourceFolderImporter:
In which folder should the importer save files/images (has to exist) `resourceFolderImporter`
---------------------------------------------------------------------------------------------
.. confval:: resourceFolderImporter
:type: string
:Default: /news_import
Define the folder which is used for the media elements which are imported.
Alternative configuration instead of Admin Tools
================================================
Instead of defining the property in the Admin Tools it is also possible to define
the properties in the :file:`AdditionalConfiguration.php`. This is useful if
you want to include the setting in version control.
.. code-block:: php
:caption: AdditionalConfiguration.php
$GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['news'] = serialize([
'archiveDate' => 'date',
'rteForTeaser' => 0,
'tagPid' => 1,
'prependAtCopy' => 0,
'categoryRestriction' => 'none',
'categoryBeGroupTceFormsRestriction' => 0,
'contentElementRelation' => 1,
'manualSorting' => 0,
'dateTimeNotRequired' => 0,
'showAdministrationModule' => 1,
'showImporter' => 0,
'storageUidImporter' => '1',
'resourceFolderImporter' => '/news_import',
]),

View File

@@ -0,0 +1,21 @@
.. include:: /Includes.rst.txt
.. _reference:
Reference
=========
In-depth reference for integrators and developers.
.. toctree::
:maxdepth: 3
:titlesonly:
:glob:
ExtensionConfiguration/Index
TypoScript/Index
TsConfig/Index
Events/Index
ViewHelpers/Index
/Misc/Changelog/Index
MissingKnownErrors/Index

View File

@@ -0,0 +1,26 @@
.. include:: /Includes.rst.txt
Known problems
--------------
The following issues are known problems. However those are either not fixable inside EXT:news or not too easy to solve!
Category images on root page
============================
Due to restrictions of the File Abstraction Layer (FAL), it is not possible to add images to categories which are
saved on the root page (uid 0). Documented at http://forge.typo3.org/issues/57515
Multilanguage
=============
The strategy of Extbase is currently quite simple. First records are fetched and afterwards an overlay is added to get the correct translated data. Problems can be:
- sorting by a translated field is not possible
- Translation of FAL records, see https://forge.typo3.org/issues/57272
DBAL
====
Extbase does not fully support DBAL, therefore it might be that things fail!
Versioning & Workspaces
=======================
It is not possible to create a version in the frontend by Extbase. As long as the versioning happens in the backend, everything should be fine.

View File

@@ -0,0 +1,273 @@
.. include:: /Includes.rst.txt
.. _tsconfigAdministration:
=====================
Administration module
=====================
Configuration of the :guilabel:`Web > News Administration` module
.. contents:: Properties
:backlinks: top
:class: compact-list
:depth: 1
:local:
.. _tsconfigPreselect:
preselect
=========
.. confval:: preselect
:type: array
:Path: tx_news > module
Predefine the form in the administration module. The possible fields for
the preselection are:
- recursive
- timeRestriction
- topNewsRestriction
- sortingField
- sortingDirection
- categoryConjunction
.. code-block:: typoscript
# Example:
tx_news.module {
preselect {
topNewsRestriction = 1
}
}
.. _tsconfigColumns:
columns
=======
.. confval:: columns
:type: string
:Path: tx_news > module
:Default: teaser,istopnews,datetime,categories
Define a list of columns which are displayed in the administration module.
Default is.
Example: Show the columns datetime, archive and author
------------------------------------------------------
.. code-block:: typoscript
tx_news.module.columns = datetime,archive,author
.. _tsconfigDefaultPid:
defaultPid
==========
.. confval:: defaultPid
:type: int
:Path: tx_news > module
If no page is selected in the page tree, any record created in the
administration module would be saved on the root page.
If this is not desired, the pid can be defined by using defaultPid.<tablename>:
Example: Set default pid for new news records
---------------------------------------------
New news records will be saved on the page with ID 123.
.. code-block:: typoscript
# Example
tx_news.module.defaultPid.tx_news_domain_model_news = 123
localizationView
================
.. confval:: localizationView
:type: bool
:Path: tx_news > module
:Default: 1
Ability to disable the localizationView in the administration module. Example:
Example: Disable the localization view
--------------------------------------
.. code-block:: typoscript
tx_news.module.localizationView = 0
controlPanels
=============
.. confval:: controlPanels
:type: bool
:Path: tx_news > module
:Default: 0
Display control panels to sort, hide and delete records in the administration
module.
Example: Enable the control panels
----------------------------------
.. code-block:: typoscript
tx_news.module.controlPanels = 1
allowedCategoryRootIds
======================
.. confval:: allowedCategoryRootIds
:type: string, comma separated list of integers
:Path: tx_news > module
Reduce the shown categories by defining a list of **root** category IDs.
Example:
.. code-block:: none
Example category tree
├── [10] Cat 1
├── [12] Cat 2
├ └──[13] Cat 2 b
├── [14] Cat 3
└── [15] Cat 4
.. code-block:: typoscript
tx_news.module.allowedCategoryRootIds = 12,15
.. code-block:: none
Category tree shown
├── [12] Cat 2
├ └──[13] Cat 2 b
└── [15] Cat 4
.. _tsconfigRedirectToPageOnStart:
redirectToPageOnStart
=====================
.. confval:: redirectToPageOnStart
:type: integer
:Path: tx_news > module
If no page is selected, the user will be redirected to the given page.
Example: redirect the user to page 456
---------------------------------------
Redirect the user to the page with the uid 456, if no other page is chosen.
.. code-block:: typoscript
# Example:
tx_news.module.redirectToPageOnStart = 456
.. _tsconfigAllowedPage:
allowedPage
===========
.. confval:: allowedPage
:type: integer
:Path: tx_news > module
If defined, limit the administration module to the given page and always
redirect the user, no matter what defined in the page tree.
Example: Limit the news module to page 123
------------------------------------------
Always redirect the user to the page with the uid 123.
.. code-block:: typoscript
# Example:
tx_news.module.allowedPage = 123
.. _tsconfigAlwaysShowFilter_:
alwaysShowFilter
================
.. confval:: alwaysShowFilter
:type: bool
:Path: tx_news > module
If defined, the administration module will always show the filter opened.
Example: Always show the filter
-------------------------------
.. code-block:: typoscript
# Example:
tx_news.module.alwaysShowFilter = 1
The user will be redirected to the page with the uid 123.
filters
=======
.. confval:: filters
:type: array
:Path: tx_news > module
Define whether filters should be available or not. By default, all the
filters are enabled. The available filters are:
- searchWord
- timeRestriction
- topNewsRestriction
- hidden
- archived
- sortingField
- number
- categories
- categoryConjunction
- includeSubCategories
.. note::
``categoryConjunction`` and ``includeSubCategories`` can only be enabled
when ``categories`` is enabled.
Example: disable the filter of top news restriction
---------------------------------------------------
.. code-block:: typoscript
# Example:
tx_news.module {
filters {
topNewsRestriction = 0
}
}

View File

@@ -0,0 +1,156 @@
.. include:: /Includes.rst.txt
.. _tsconfigGeneral:
=====================
General configuration
=====================
The general configuration covers options available during the creation
and editing of news records.
.. contents:: Properties
:backlinks: top
:class: compact-list
:depth: 1
:local:
.. _tsconfigTemplateLayouts:
templateLayouts
===============
.. confval:: templateLayouts
:type: array
:Path: tx_news
The select box :guilabel:`Template Layout` inside a plugin can be extended by
using TSconfig. Contains an array with key-value pairs. It is possible to
define Groups using the :typoscript:`--div--` keyword.
allowedColPos
Limit a layout to a list of colPos values.
Examples: Add template layouts
------------------------------
Show 3 layout options with the specified key / value pairs.
.. code-block:: typoscript
tx_news.templateLayouts {
1 = Foobar
2 = Another one
3 = --div--,Group 2
4 = Blub
}
You can use this setting within the Fluid template by checking
:fluid:`{settings.templateLayout}`. See a complete example:
:ref:`Template selector tutorial <templatesSelector>`.
By using the configuration :php:`allowedColPos` it is possible to restrict a
template layout to a specific list of colPos values.
.. code-block:: typoscript
tx_news.templateLayouts {
1 = Foobar
2 = Another one
2.allowedColPos = 1,2,3
3 = --div--,Group 2
4 = Blub
4.allowedColPos = 0,1
}
.. _tsconfigArchive:
archive
=======
.. confval:: archive
:type: string
:Path: tx_news
Use strtotime (see `http://www.php.net/strtotime <http://www.php.net/strtotime>`__ )
to predefine the archive date
Example: Set the archive date
-----------------------------
Set the archive date on the the next friday:
.. code-block:: typoscript
# Example:
tx_news.predefine.archive = next friday
.. _tsconfigTagPid:
tagPid
======
.. confval:: tagPid
:type: integer
:Path: tx_news
Besides the configuration in the
:ref:`Extension Configuration <extensionConfigurationTagPid>` it is also
possible to define the pid of tags created directly in the news record by
using TSconfig:
Example: store new tags on page 123
-----------------------------------
Store new tags on page 123.
.. code-block:: typoscript
# Example:
tx_news.tagPid = 123
.. _tsconfigCategoryRestrictionForFlexForms:
categoryRestrictionForFlexForms
===============================
.. confval:: categoryRestrictionForFlexForms
:type: bool
:Path: tx_news
After defining the category restriction in the
:ref:`Extension Configuration <extensionConfigurationCategoryRestriction>`
it is also possible to restrict the categories in the news plugin.
This needs to enabled by TsConfig:
.. code-block:: typoscript
# Example:
tx_news.categoryRestrictionForFlexForms = 1
.. _tsconfigShowContentElementsInNewsSysFolder:
showContentElementsInNewsSysFolder
==================================
.. confval:: showContentElementsInNewsSysFolder
:type: bool
:Path: tx_news
If a sys folder is configured with **Contains Plugin:** `News`,
content elements are hidden on those pages in the page and list module.
If the content elements should be shown, use the Page TsConfig.
.. code-block:: typoscript
# Example:
tx_news.showContentElementsInNewsSysFolder = 1

View File

@@ -0,0 +1,66 @@
.. include:: /Includes.rst.txt
.. _tsconfig:
========
TsConfig
========
This section covers all configurations that can be made with the TSconfig
shipped by the extension news. If you are interested in what you can do
with the general TsConfig in news records have a look at
:ref:`General TSconfig examples <general_tsconfig_examples>`.
Every TSconfig configuration of extension news starts with :typoscript:`tx_news.`.
.. note::
Just for clarification: TsConfig is in TYPO3 only used for configurations
inside the backend!
.. container:: row m-0 p-0
.. container:: col-12 col-md-6 pl-0 pr-3 py-3 m-0
.. container:: card px-0 h-100
.. rst-class:: card-header h3
.. rubric:: :ref:`General TSconfig <tsconfigGeneral>`
.. container:: card-body
The general configuration covers options available during
the creation and editing of news records.
.. container:: col-12 col-md-6 pl-0 pr-3 py-3 m-0
.. container:: card px-0 h-100
.. rst-class:: card-header h3
.. rubric:: :ref:`Administration module <tsconfigAdministration>`
.. container:: card-body
Configuration of the :guilabel:`Web > News Administration` module
.. container:: col-12 col-md-6 pl-0 pr-3 py-3 m-0
.. container:: card px-0 h-100
.. rst-class:: card-header h3
.. rubric:: :ref:`Plugin configuration <tsconfigPlugin>`
.. container:: card-body
This section covers settings which influence the news plugin
.. toctree::
:maxdepth: 3
:glob:
General
Administration
Plugin

View File

@@ -0,0 +1,41 @@
.. include:: /Includes.rst.txt
.. _tsconfigPlugin:
====================
Plugin configuration
====================
This section covers settings which influence the news plugin.
switchableControllerAction
==========================
.. confval:: switchableControllerAction
:type: array
:Path: TCEFORM > tt_content > pi_flexform > news_pi1.sDEF
:Default:
- News->list
- News->detail
- News->dateMenu
- News->searchForm
- News->searchResult
- Category->list
- Tag->list
To remove a specific action from the News Plugin selectbox, use
this snippet.
Example: Remove the action Tag->list
------------------------------------
.. code-block:: typoscript
# Example:
TCEFORM.tt_content.pi_flexform.news_pi1.sDEF {
switchableControllerActions.removeItems = Tag->list
}

View File

@@ -0,0 +1,677 @@
.. include:: /Includes.rst.txt
.. highlight:: typoscript
.. _typoscriptGeneral:
================
General settings
================
Any setting needs to be prefixed with :typoscript:`plugin.tx_news.settings.`.
.. only:: html
.. contents:: Properties
:depth: 1
:local:
.. _tsCssFile:
cssFile
=======
.. confval:: cssFile
:type: string
:Default: Depends on the chosen layout
:Path: plugin.tx_news.settings
Path to the css file. This is included with the Layouts.
.. _tsFormat:
format
======
.. confval:: format
:type: string
:Default: html
:Path: plugin.tx_news.settings
Set a different format for the output. Use e.g. :code:`xml` for RSS feeds.
useStdWrap
==========
.. confval:: useStdWrap
:type: string
:Default: singleNews
:Path: plugin.tx_news.settings
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 {
# ...
}
}
.. _tsOverrideFlexformSettingsIfEmpty:
overrideFlexformSettingsIfEmpty
===============================
.. confval:: overrideFlexformSettingsIfEmpty
:type: string
:Path: plugin.tx_news.settings
:Default: cropMaxCharacters,dateField,timeRestriction,orderBy,orderDirection,
backPid,listPid,startingpoint,
recursive,list.paginate.itemsPerPage,list.paginate.templatePath
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 value should be taken from
TypoScript if nothing is set in the plugin.
.. _tsDisplayDummyIfNoMedia:
displayDummyIfNoMedia
=====================
.. confval:: displayDummyIfNoMedia
:type: boolean
:Path: plugin.tx_news.settings
:Default: 1
If set and no preview image is defined in the record, a placeholder
image defined via :confval:`list.media.dummyImage` is shown.
.. confval:: list.media.dummyImage
:type: string
:Default: typo3conf/ext/news/Resources/Public/Images/dummy-preview-image.png
If preview image is defined, the defined placeholder is displayed.
Example: Display a dummy image from your sitepackage
----------------------------------------------------
.. code-block:: typoscript
:caption: my_sitepackage/Configuration/TypoScript/setup.typoscript
plugin.tx_news.settings {
displayDummyIfNoMedia = 1
list.media.dummyImage = EXT:my_sitepackage/Resources/Public/Images/News/MyPreviewImage.png
}
Example: Remove dummy image from list view
------------------------------------------
.. code-block:: typoscript
:caption: my_sitepackage/Configuration/TypoScript/setup.typoscript
plugin.tx_news.settings {
displayDummyIfNoMedia = 0
}
.. _tsDetailPidDetermination:
detailPidDetermination
======================
.. confval:: detailPidDetermination
:type: string, comma separated list of keywords
:Default: "flexform, categories, default"
:Path: plugin.tx_news.settings
This setting 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
This setting tries to get the detail page from the plugin's setting
:confval:`detailPid` :guilabel:`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 :confval:`defaultDetailPid`::
plugin.tx_news.settings.defaultDetailPid = 456
.. _tsDefaultDetailPid:
defaultDetailPid
================
.. confval:: defaultDetailPid
:type: int
:Default: 0
:Path: plugin.tx_news.settings
If :confval:`detailPidDetermination` contains the keyword "default" this
value is used to determine the pid used for detail links of news records.
.. _tsHideIdList:
hideIdList
==========
.. confval:: hideIdList
:type: string
:Default: (none)
:Path: plugin.tx_news.settings
Define a list of ids of news articles which are excluded in the view. This
is similar to the setting :confval:`excludeAlreadyDisplayedNews` but the
exclusion is defined in TypoScript instead of the template.
Example: Hide current news in the list
--------------------------------------
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
}
}
.. _tsOrderByAllowed:
orderByAllowed
==============
.. confval:: orderByAllowed
:type: string
:Default: sorting,author,uid,title,teaser,author,tstamp,crdate,datetime,categories.title
:Path: plugin.tx_news.settings
Due to restrictions of Extbase itself it is required to define all fields
which are allowed for sorting results.
.. _tsAnalyticsSocial:
analytics.social
================
.. confval:: analytics.social
:type: array
Use additional code for google analytics tracking of the social
functionalities.
Default::
analytics.social {
facebookLike = 1
facebookShare = 1
twitter = 1
}
.. _tsDemandClass:
demandClass
===========
.. confval:: demandClass
:type: string
:Path: plugin.tx_news.settings
Overload the demand object which is used to build the queries. Read more
about how to use and extend :ref:`demands <demands>`.
.. _tsLinkHrDate:
link.hrDate
===========
.. confval:: link.hrDate
:type: boolean / array
:Default: 0
:Path: plugin.tx_news.settings
The url to a single news record contains only the uid of the record.
Sometimes it is nice to have the date in url too (for example
:samp:`https://example.org/news/2021/8/news-title.html`).
If this setting is enabled parameters for year, month and day are added
to the URL. A :ref:`Routing configuration <routing>` can then be used
to create a human readable date like the example above.
Each parameter (day, month, year) can be separately configured by using
the full options of the `php function date()
<http://at2.php.net/manual/en/function.date.php>`_ . This example will
add the day as a number without leading zeros, the month with leading
zeros and the year by using 4 digits::
link = 1
link {
hrDate = 1
hrDate {
day = j
month = m
year = Y
}
}
This option is only applied if the build-in
:ref:`LinkViewHelper <viewHelperLink>` is used
.. _tsLinkTypesOpeningInNewWindow:
link.typesOpeningInNewWindow
============================
.. confval:: link.typesOpeningInNewWindow
:type: string
:Default: 2
:Path: plugin.tx_news.settings
Comma separated list of news types which open with :html:`target="_blank"`
Default is 2 which is the news type "Link to external page".
This option is only applied if the build-in
:ref:`LinkViewHelper <viewHelperLink>` is used.
.. _tsFacebookLocale:
facebookLocale
==============
.. confval:: facebookLocale
:type: string
:Default: en\_US
:Path: plugin.tx_news.settings
Facebook locale which is used to translate facebook texts.
Examples are de\_DE, fr\_FR, ...
.. _tsOpengraph:
opengraph
=========
.. confval:: opengraph
:type: array
:Path: plugin.tx_news.settings
Additional open graph properties can be defined using TypoScript.
Those are included in the the template partial
:file:`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
locale =
admins =
twitter {
card = {$plugin.tx_news.opengraph.twitter.card}
site = {$plugin.tx_news.opengraph.twitter.site}
creator = {$plugin.tx_news.opengraph.twitter.creator}
}
}
.. _tsDetailMedia:
detail.media
============
.. confval:: detail.media
:type: array
:Path: plugin.tx_news.settings
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
}
}
.. _tsDetailErrorHandling:
detail.errorHandling
====================
.. confval:: detail.errorHandling
:type: string
:Path: plugin.tx_news.settings
:Default: "showStandaloneTemplate,EXT:news/Resources/Private/Templates/News/DetailNotFound.html,404"
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>`, for example
`showStandaloneTemplate,EXT:news/Resources/Private/Templates/News/DetailNotFound.html,404`
redirectToListView
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 page not found handler defined in the site configuration is called.
Example: Show a custom not found template
-----------------------------------------
If the current news record is not found, show the custom template instead and
return the HTTP-code `404` (not found)::
plugin.tx_news.settings.detail.errorHandling = showStandaloneTemplate,EXT:my_sitepackage/Resources/Private/Templates/NotFound.html,404
Example: Redirect to page 123 if news record is not found
---------------------------------------------------------
If the current news record is not found, forward to page 123 with
the HTTP-code `301` (moved permanently)::
plugin.tx_news.settings.detail.errorHandling = redirectToPage,123,301
.. _tsDetailCheckPidOfNewsRecord:
detail.checkPidOfNewsRecord
===========================
.. confval:: detail.checkPidOfNewsRecord
:type: boolean
:Default: 0
If set, the detail view checks the incoming news record against the defined
:confval:`startingpoint`.
If those don't match, the news record won't be displayed and
:confval:`detail.errorHandling` applied.
.. _tsDetailShowMetaTags:
detail.showMetaTags
===================
.. confval:: detail.showMetaTags
:type: boolean
:Path: plugin.tx_news.settings
:Default: 1
If enabled, the meta tags including title, description and various
open graph tags (defined in :confval:`opengraph`) are rendered.
.. _tsDetailShowPrevNext:
detail.showPrevNext
===================
.. confval:: detail.showPrevNext
:type: boolean
:Default: 0
If enabled, links to the previous and next news records are shown
.. _tsDetailRegisterProperties:
detail.registerProperties
=========================
.. confval:: detail.registerProperties
:type: string
:Path: plugin.tx_news.settings
:Default: keywords,title
This property is currently not used.
.. _tsDetailShowSocialShareButtons:
detail.showSocialShareButtons
=============================
.. confval:: detail.showSocialShareButtons
:type: boolean
:Default: 1
If the extension `rx_shariff <https://extensions.typo3.org/extension/rx_shariff>`__
is installed and this option is enabled,
the social share functionality provided by rx\_shariff is shown.
You can install this extension with composer:
.. code-block:: bash
:caption: bash
composer req reelworx/rx-shariff
list.media
==========
.. confval:: list.media
:type: array
:Path: plugin.tx_news.settings
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
}
}
.. _tsListPaginate:
list.paginate
=============
.. confval:: list.paginate
:type: array
:Path: plugin.tx_news.settings
EXT:news uses a custom ViewHelper to render the pagination.
The following settings are available:
class
The class that should be used for the pagination
itemsPerPage
Define how many items are shown on one page.
insertAbove
Set it to `0` to hide the pagination before the actual news items.
insertBelow
Set it to `0` to 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.
Default::
list.paginate {
class = GeorgRinger\NumberedPagination\NumberedPagination
itemsPerPage = 10
insertAbove = 1
insertBelow = 1
maximumNumberOfLinks = 3
}
.. _tsListRss:
list.rss
========
.. confval:: list.rss
:type: array
:Path: plugin.tx_news.settings
Additional settings for the RSS view.
See the :ref:`RSS configuration <rss>`.
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}
}
}
.. _tsSearchFields:
search.fields
=============
.. confval:: search.fields
:type: string
:Path: plugin.tx_news.settings
:Default: teaser,title,bodytext
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
:code:`categories.title`
search.splitSearchWord
======================
.. confval:: search.splitSearchWord
:type: boolean
:Path: plugin.tx_news.settings
:Default: 0
If set to `1`, the search subject will be split 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.
.. hint::
If you need a better search experience, think about using something like EXT:solr!

View File

@@ -0,0 +1,47 @@
.. include:: /Includes.rst.txt
.. Set default language for code-blocks to TypoScript for this page!
.. highlight:: typoscript
.. _ts:
.. _typoscript:
==========
TypoScript
==========
This page is divided into the following sections which are all configurable by using TypoScript:
.. container:: row m-0 p-0
.. container:: col-12 col-md-6 pl-0 pr-3 py-3 m-0
.. container:: card px-0 h-100
.. rst-class:: card-header h3
.. rubric:: :ref:`Plugin settings <typoscriptPlugin>`
.. container:: card-body
This section covers all settings, which can be defined in the
plugin itself.
.. container:: col-12 col-md-6 pl-0 pr-3 py-3 m-0
.. container:: card px-0 h-100
.. rst-class:: card-header h3
.. rubric:: :ref:`General settings <typoscriptGeneral>`
.. container:: card-body
Configuration of the :guilabel:`Web > News Administration` module
.. toctree::
:maxdepth: 3
:glob:
PluginSettings
GeneralSettings

View File

@@ -0,0 +1,635 @@
.. include:: /Includes.rst.txt
.. highlight:: typoscript
.. _typoscriptPlugin:
===============
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 :confval:`orderBy` is for example not needed in the single view).
.. important::
Every setting can also be defined by TypoScript setup. However, please inform
yourself about the setting :confval:`overrideFlexformSettingsIfEmpty`.
.. only:: html
.. contents:: Properties
:depth: 1
:local:
Sheet general
=============
.. _tsOrderBy:
Sort by `orderBy`
-----------------
.. confval:: orderBy
:type: string
:Default: 'datetime'
:Path: plugin.tx_news.settings
:Scope: Plugin, TypoScript Setup
Define the sorting of displayed news records.
The chapter ":ref:`Extend news > Extend flexforms <extendFlexforms>`"
shows how the select box can be extended.
.. _tsOrderDirection:
Sort direction `orderDirection`
-------------------------------
.. confval:: orderDirection
:type: string
:Default: 'desc'
:Path: plugin.tx_news.settings
:Scope: Plugin, TypoScript Setup
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
.. _tsDateField:
Date field to use `dateField`
-----------------------------
.. confval:: dateField
:type: string
:Default: 'datetime'
:Path: plugin.tx_news.settings
:Scope: Plugin, TypoScript Setup
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.
.. _tsCategories:
Category selection `categories`
-------------------------------
.. confval:: categories
:type: string
:Default: (none)
:Path: plugin.tx_news.settings
:Scope: Plugin, TypoScript Setup
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.
.. _tsCategoryConjunction:
Category mode `categoryConjunction`
-----------------------------------
.. confval:: categoryConjunction
:type: int
:Default: 0 (Don't care, show all)
:Path: plugin.tx_news.settings
:Scope: Plugin, TypoScript Setup
The category mode defines how 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 = 2
.. _tsIncludeSubCategories:
Include subcategories `includeSubCategories`
--------------------------------------------
.. confval:: includeSubCategories
:type: boolean
:Default: 0
:Path: plugin.tx_news.settings
:Scope: Plugin, TypoScript Setup
Include subcategories in the category selection
::
plugin.tx_news.settings.includeSubCategories = 1
.. _tsArchiveRestriction:
Archive `archiveRestriction`
----------------------------
.. confval:: archiveRestriction
:type: string
:Default: (none)
:Path: plugin.tx_news.settings
:Scope: Plugin, TypoScript Setup
::
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 in the future 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.
.. _tsTimeRestriction:
Time limit (LOW) `timeRestriction`
----------------------------------
.. confval:: timeRestriction
:type: string
:Default: (none)
:Path: plugin.tx_news.settings
:Scope: Plugin, TypoScript Setup
::
plugin.tx_news.settings.timeRestriction =-1 week
The time limit offers 3 different options.
**Date**
A date in the format `HH:mm DD-MM-YYYY` can be set and only news records that are newer than this date are shown.
Example: 15:30 01-04-2020 (April 1st, 2020 at 3.30 pm)
**Time in seconds**
Only news records with a maximum age (compared to the :guilabel:`Date & Time` field) are shown.
Example: An input like :code:`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 <http://de.php.net/strtotime>`__ .
.. _tsTimeRestrictionHigh:
Time limit (HIGH) `timeRestrictionHigh`
---------------------------------------
.. confval:: timeRestrictionHigh
:type: string
:Default: (none)
:Path: plugin.tx_news.settings
:Scope: Plugin, TypoScript Setup
See :confval:`timeRestriction` above. The configuration is the same but for the higher time end.
.. _tsTopNewsRestriction:
Top news `topNewsRestriction`
-----------------------------
.. confval:: topNewsRestriction
:type: int
:Default: 0
::
plugin.tx_news.settings.topNewsRestriction =2
Any news record can be set as :guilabel:`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.
.. _tsSingleNews:
Show a single news record `singleNews`
--------------------------------------
.. confval:: singleNews
:type: int
:Default: 0
:Path: plugin.tx_news.settings
:Scope: Plugin, TypoScript Setup
::
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.
.. _tsPreviewHiddenRecords:
Allow preview of hidden records `previewHiddenRecords`
------------------------------------------------------
.. confval:: previewHiddenRecords
:type: int
:Default: 0
:Path: plugin.tx_news.settings
:Scope: Plugin, TypoScript Setup
::
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.
The setting :confval:`enablePreviewOfHiddenRecords` is needed (instead of
:confval:`previewHiddenRecords`) if the detail view plugin is used and the plugin
configuration option :confval:`previewHiddenRecords` is set to
"Defined in TypoScript" (value `2`).
.. note::
Be aware to secure the page (e.g. using a TypoScript condition to make it
available only if an backend 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!
.. confval:: enablePreviewOfHiddenRecords
:type: int
:Default: 0
:Path: plugin.tx_news.settings
:Scope: TypoScript Setup
::
plugin.tx_news.settings.previewHiddenRecords = 2
plugin.tx_news.settings.enablePreviewOfHiddenRecords = 1
If :confval:`previewHiddenRecords` is set to `2` the setting of
:confval:`enablePreviewOfHiddenRecords` is used instead.
.. _tsStartingpoint:
Startingpoint `startingpoint`
-----------------------------
.. confval:: startingpoint
:type: string
:Default: (none)
:Path: plugin.tx_news.settings
:Scope: Plugin, TypoScript Setup
::
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.
.. _tsRecursive:
Recursive `recursive`
---------------------
.. confval:: recursive
:type: int
:Default: 0 (No recursion)
:Path: plugin.tx_news.settings
:Scope: Plugin, TypoScript Setup
::
plugin.tx_news.settings.recursive = 2
The search for pages as startingpoint can be extended by setting a recursive
level.
Sheet additional
================
.. _tsDetailPid:
PageId for single news display `detailPid`
------------------------------------------
.. confval:: detailPid
:type: int
:Default: 0 (none)
:Path: plugin.tx_news.settings
:Scope: Plugin, TypoScript Setup
::
plugin.tx_news.settings.detailPid =12
This page is used 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
:confval:`detailPidDetermination`.
.. _tsListPid:
PageId for list display `listPid`
=================================
.. confval:: listPid
:type: int
:Default: 0 (none)
:Path: plugin.tx_news.settings
:Scope: Plugin, TypoScript Setup
::
plugin.tx_news.settings.listPid =12
This page is used as target for the listings, for example the date menu and
the search form.
.. _tsBackPid:
PageId to return to `backPid`
-----------------------------
.. confval:: backPid
:type: int
:Default: 0 (none)
:Path: plugin.tx_news.settings
:Scope: Plugin, TypoScript Setup
::
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.
.. _tsLimit:
Max records displayed `limit`
-----------------------------
.. confval:: limit
:type: int
:Default: 0 (none)
:Path: plugin.tx_news.settings
:Scope: Plugin, TypoScript Setup
::
plugin.tx_news.settings.limit =10
Define the maximum records shown.
.. _tsOffset:
Starting with given news record `offset`
----------------------------------------
.. confval:: offset
:type: int
:Default: (none)
:Path: plugin.tx_news.settings
:Scope: Plugin, TypoScript Setup
::
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 :confval:`limit`.
.. _tsTags:
Tags `tags`
-----------
.. confval:: tags
:type: string
:Default: (none)
:Path: plugin.tx_news.settings
:Scope: Plugin, TypoScript Setup
Add a constraint to the given tags
.. _tsHidePagination:
Hide the pagination `hidePagination`
------------------------------------
.. confval:: hidePagination
:type: boolean
:Default: 0 (do not hide)
:Path: plugin.tx_news.settings
:Scope: Plugin, TypoScript Setup
If defined, the pagination is not shown.
.. _tsListPaginateItemsPerPage:
Items per Page `list.paginate.itemsPerPage`
-------------------------------------------
.. confval:: list.paginate.itemsPerPage
:type: int
:Default: 10
:Path: plugin.tx_news.settings
:Scope: Plugin, TypoScript Setup
Define the amount of news items shown per page in the pagination.
.. _tsTopNewsFirst:
Sort "Top news" before `topNewsFirst`
-------------------------------------
.. confval:: topNewsFirst
:type: boolean
:Default: 0 (Do not show top news first)
:Path: plugin.tx_news.settings
:Scope: Plugin, TypoScript Setup
::
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.
.. _tsExcludeAlreadyDisplayedNews:
Exclude already displayed news `excludeAlreadyDisplayedNews`
-------------------------------------------------------------
.. confval:: excludeAlreadyDisplayedNews
:type: boolean
:Default: 0 (Do not exclude)
:Path: plugin.tx_news.settings
:Scope: Plugin, TypoScript Setup
::
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.
.. _tsDisableOverrideDemand:
Disable override demand `disableOverrideDemand`
-----------------------------------------------
.. confval:: disableOverrideDemand
:type: boolean
:Default: 1 (Disable override)
:Path: plugin.tx_news.settings
:Scope: Plugin, TypoScript Setup
::
plugin.tx_news.settings.disableOverrideDemand =1
If set, the settings of the plugin can't be overridden by arguments in
the URL. Read more about :ref:`demands <demands>`.
Sheet template
==============
.. _tsMediaMaxWidth:
Max width for media elements `media.maxWidth`
---------------------------------------------
.. confval:: media.maxWidth
:type: int
:Default: 0 (none)
:Path: plugin.tx_news.settings
:Scope: Plugin, TypoScript Setup
Maximum width of assets
.. _tsMediaMaxHeight:
Max height for media elements `media.maxHeight`
-----------------------------------------------
.. confval:: media.maxHeight
:type: int
:Default: 0 (none)
:Path: plugin.tx_news.settings
:Scope: Plugin, TypoScript Setup
Maximum height of assets
.. _tsCropMaxCharacters:
Length of teaser (in chars) `cropMaxCharacters`
-----------------------------------------------
.. confval:: cropMaxCharacters
:type: int
:Default: 0 (do not crop)
:Path: plugin.tx_news.settings
:Scope: Plugin, TypoScript Setup
::
plugin.tx_news.settings.cropMaxCharacters =100
Define the maximum length of the teaser text before it is cropped.
.. _tsTemplateLayout:
Template Layout `templateLayout`
--------------------------------
.. confval:: templateLayout
:type: string
:Default: (none, use default)
:Path: plugin.tx_news.settings
:Scope: Plugin, TypoScript Setup
::
plugin.tx_news.settings.templateLayout = 123
Select different layouts. See :ref:`this section <tsconfigTemplateLayouts>`
how to add layouts.

View File

@@ -0,0 +1,47 @@
ExcludeDisplayedNewsViewHelper
-----------------------------------
ViewHelper to exclude news items in other plugins
**Type:** Basic
General properties
^^^^^^^^^^^^^^^^^^^^^^^
.. t3-field-list-table::
:header-rows: 1
- :Name: Name:
:Type: Type:
:Description: Description:
:Default value: Default value:
- :Name:
\* newsItem
:Type:
Tx\_News\_Domain\_Model\_News
:Description:
current news item
:Default value:
Examples
^^^^^^^^^^^^^
Basic example
""""""""""""""""""
Code: ::
<n:excludeDisplayedNews newsItem="{newsItem}" />
Output: ::
None

View File

@@ -0,0 +1,28 @@
Format / NothingViewHelper
-------------------------------
ViewHelper to render children which don't print out any actual content
**Type:** Basic
Examples
^^^^^^^^^^^^^
Basic example
""""""""""""""""""
Code: ::
<n:format.nothing>
<n:titleTag>{newsItem.title}</n:titleTag>
Fobar
</n:format.nothing>
Output: ::
nothing

View File

@@ -0,0 +1,30 @@
HeaderDataViewHelper
-------------------------
ViewHelper to render data in <head> section of website
**Type:** Basic
Examples
^^^^^^^^^^^^^
Basic example
""""""""""""""""""
Code: ::
<n:headerData>
<link rel="alternate"
type="application/rss+xml"
title="RSS 2.0"
href="{f:uri.page(pageType: settings.list.rss.channel.typeNum)}" />
</n:headerData>
Output: ::
Added to the header: <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="uri to this page and type 9818" />

View File

@@ -0,0 +1,56 @@
IncludeFileViewHelper
--------------------------
ViewHelper to include a css/js file
**Type:** Basic
General properties
^^^^^^^^^^^^^^^^^^^^^^^
.. t3-field-list-table::
:header-rows: 1
- :Name: Name:
:Type: Type:
:Description: Description:
:Default value: Default value:
- :Name:
compress
:Type:
boolean
:Description:
Define if file should be compressed
:Default value:
- :Name:
\* path
:Type:
string
:Description:
Path to the CSS/JS file which should be included
:Default value:
Examples
^^^^^^^^^^^^^
Basic example
""""""""""""""""""
Code: ::
<n:includeFile path="{settings.cssFile}" />
Output: ::
This will include the file provided by {settings} in the header

View File

@@ -0,0 +1,47 @@
.. include:: /Includes.rst.txt
.. highlight:: html
.. _viewHelpersReference:
=====================
ViewHelpers reference
=====================
In order to use the ViewHelpers provided by this extension, you need to include
them in the :html:`<html>` tag of your template or partial:
.. code-block:: html
<html xmlns:n="http://typo3.org/ns/GeorgRinger/News/ViewHelpers"
xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
data-namespace-typo3-fluid="true">
You can find all available ViewHelpers in the folder
:file:`EXT:news/Classes/ViewHelpers`.
.. todo: Automatically document the ViewHelpers
All ViewHelpers
===============
.. toctree::
:maxdepth: 5
:titlesonly:
:glob:
ExcludeDisplayedNewsViewHelper
HeaderDataViewHelper
IncludeFileViewHelper
LinkViewHelper
MediaFactoryViewHelper
MetaTagViewHelper
PaginateBodytextViewHelper
TargetLinkViewHelper
TitleTagViewHelper
Format/NothingViewHelper
Widget/PaginateViewHelper

View File

@@ -0,0 +1,219 @@
.. include:: /Includes.rst.txt
.. _viewHelperLink:
LinkViewHelper
-------------------
ViewHelper to render links from news records to detail view or page
**Type:** Tag Based
General properties
^^^^^^^^^^^^^^^^^^^^^^^
.. t3-field-list-table::
:header-rows: 1
- :Name: Name:
:Type: Type:
:Description: Description:
:Default value: Default value:
- :Name:
accesskey
:Type:
string
:Description:
Keyboard shortcut to access this element
:Default value:
- :Name:
additionalAttributes
:Type:
array
:Description:
Additional tag attributes. They will be added directly to the resulting HTML tag.
:Default value:
- :Name:
class
:Type:
string
:Description:
CSS class(es) for this element
:Default value:
- :Name:
configuration
:Type:
array
:Description:
optional typolink configuration
:Default value:
Array
- :Name:
dir
:Type:
string
:Description:
Text direction for this HTML element. Allowed strings\: "ltr" (left to right), "rtl" (right to left)
:Default value:
- :Name:
id
:Type:
string
:Description:
Unique (in this file) identifier for this HTML element.
:Default value:
- :Name:
lang
:Type:
string
:Description:
Language for this element. Use short names specified in RFC 1766
:Default value:
- :Name:
\* newsItem
:Type:
Tx\_News\_Domain\_Model\_News
:Description:
current news object
:Default value:
- :Name:
onclick
:Type:
string
:Description:
JavaScript evaluated for the onclick event
:Default value:
- :Name:
settings
:Type:
array
:Description:
:Default value:
Array
- :Name:
style
:Type:
string
:Description:
Individual CSS styles for this element
:Default value:
- :Name:
tabindex
:Type:
integer
:Description:
Specifies the tab order of this element
:Default value:
- :Name:
title
:Type:
string
:Description:
Tooltip text of element
:Default value:
- :Name:
uriOnly
:Type:
boolean
:Description:
return only the url without the a-tag
:Default value:
Examples
^^^^^^^^^^^^^
Basic link
"""""""""""""""
Code: ::
<n:link newsItem="{newsItem}" settings="{settings}">
{newsItem.title}
</n:link>
Output: ::
A link to the given news record using the news title as link text
Set an additional attribute
""""""""""""""""""""""""""""""""
Available: class, dir, id, lang, style, title, accesskey, tabindex, onclick
Code: ::
<n:link newsItem="{newsItem}" settings="{settings}" class="a-link-class">fo</n:link>
Output: ::
<a href="link" class="a-link-class">fo</n:link>
Return the link only
"""""""""""""""""""""""""
Code: ::
<n:link newsItem="{newsItem}" settings="{settings}" uriOnly="1" />
Output: ::
The uri is returned
Add additional parameters to the url
""""""""""""""""""""""""""""""""""""
Code: ::
<n:link newsItem="{newsItem}" settings="{settings}" configuration="{additionalParams:'&tx_news_pi1[category]=111'}">fo</n:link>
Output: ::
<a href="link&tx_news_pi1[category]=111">fo</n:link>

View File

@@ -0,0 +1,54 @@
MediaFactoryViewHelper
---------------------------
ViewHelper to show videos
**Type:** Basic
General properties
^^^^^^^^^^^^^^^^^^^^^^^
.. t3-field-list-table::
:header-rows: 1
- :Name: Name:
:Type: Type:
:Description: Description:
:Default value: Default value:
- :Name:
\* classes
:Type:
string
:Description:
list of classes which are used to render the media object
:Default value:
- :Name:
\* element
:Type:
Tx\_News\_Domain\_Model\_Media
:Description:
Current media object
:Default value:
- :Name:
\* height
:Type:
integer
:Description:
height
:Default value:
- :Name:
\* width
:Type:
integer
:Description:
width
:Default value:

View File

@@ -0,0 +1,108 @@
MetaTagViewHelper
----------------------
ViewHelper to render meta tags
**Type:** Tag Based
General properties
^^^^^^^^^^^^^^^^^^^^^^^
.. t3-field-list-table::
:header-rows: 1
- :Name: Name:
:Type: Type:
:Description: Description:
:Default value: Default value:
- :Name:
additionalAttributes
:Type:
array
:Description:
Additional tag attributes. They will be added directly to the resulting HTML tag.
:Default value:
- :Name:
content
:Type:
string
:Description:
Content of meta tag
:Default value:
- :Name:
forceAbsoluteUrl
:Type:
boolean
:Description:
If set, absolute url is forced
:Default value:
- :Name:
property
:Type:
string
:Description:
Property of meta tag
:Default value:
- :Name:
useCurrentDomain
:Type:
boolean
:Description:
If set, current domain is used
:Default value:
- :Name:
name
:Type:
string
:Description:
If set, the meta tag is built by using the attribute name="" instead of property
:Default value:
Examples
^^^^^^^^^^^^^
Basic Example: News title as og:title meta tag
"""""""""""""""""""""""""""""""""""""""""""""""""""
Code: ::
<n:metaTag property="og:title" content="{newsItem.title}" />
Output: ::
<meta property="og:title" content="TYPO3 is awesome" />
Force the attribute "name"
"""""""""""""""""""""""""""""""
Code: ::
<n:metaTag name="keywords" content="{newsItem.keywords}" />
Output: ::
<meta name="keywords" content="news 1, news 2" />

View File

@@ -0,0 +1,55 @@
PaginateBodytextViewHelper
-------------------------------
Paginate the bodytext which is very useful for longer texts or to increase
**Type:** Basic
General properties
^^^^^^^^^^^^^^^^^^^^^^^
.. t3-field-list-table::
:header-rows: 1
- :Name: Name:
:Type: Type:
:Description: Description:
:Default value: Default value:
- :Name:
\* as
:Type:
string
:Description:
name of property which holds the text
:Default value:
- :Name:
\* currentPage
:Type:
integer
:Description:
Selected page
:Default value:
- :Name:
\* object
:Type:
Tx\_News\_Domain\_Model\_News
:Description:
current news object
:Default value:
- :Name:
token
:Type:
string
:Description:
Token used to split the text
:Default value:
###more###

View File

@@ -0,0 +1,47 @@
TargetLinkViewHelper
-------------------------
ViewHelper to get the target out of the typolink
**Type:** Basic
General properties
^^^^^^^^^^^^^^^^^^^^^^^
.. t3-field-list-table::
:header-rows: 1
- :Name: Name:
:Type: Type:
:Description: Description:
:Default value: Default value:
- :Name:
\* link
:Type:
string
:Description:
:Default value:
Examples
^^^^^^^^^^^^^
Basic Example
""""""""""""""""""
{relatedLink.uri} is defined as "123 _blank"
Code: ::
<f:link.page pageUid="{relatedLink.uri}" target="{n:targetLink(link:relatedLink.uri)}">Link</Link>
Output: ::
A link to the page with uid 123 and target set to "_blank"

View File

@@ -0,0 +1,25 @@
TitleTagViewHelper
-----------------------
ViewHelper to render the page title
**Type:** Basic
Examples
^^^^^^^^^^^^^
Basic Example
""""""""""""""""""
Render the content of the VH as page title
Code: ::
<n:titleTag>{newsItem.title}</n:titleTag>
Output: ::
<title>TYPO3 is awesome</title>

View File

@@ -0,0 +1,45 @@
Widget / PaginateViewHelper
--------------------------------
This ViewHelper renders a Pagination of objects.
**Type:** Widget
General properties
^^^^^^^^^^^^^^^^^^^^^^^
.. t3-field-list-table::
:header-rows: 1
- :Name: Name
:Type: Type
:Description: Description
:Default value: Default value
- :Name:
\* as
:Type:
string
:Description:
:Default value:
- :Name:
configuration
:Type:
mixed
:Description:
:Default value:
Array
- :Name:
\* objects
:Type:
TYPO3\\CMS\\Extbase\\Persistence\\QueryResultInterface
:Description:
:Default value: