**Note**: sg_news can be used for free or by buying a licence key from our <ahref="https://shop.sgalinski.de/products/"target="_blank">online shop</a>. You can enter the licence key in the extension manager configuration of sg_news.
Features excluded from the free version:
* Multilanguage News Administration
* Page Module link in News Module
* News Module link in Page Module
## About
Integrates a powerful News system. News and Categories can be created like normal TYPO3 pages. Newspages have several
additional meta information.
### Why does it need the extension "stefanfroemken/repair_translation"?
This extensions adds the behaviour, that the images of the localization of a news or categories could be differ
to the image in the default language. So the images can be translated now.
## Integration
Before using sg_news you need to supply your frontend some information on how the extension needs to be integrated into your template.
Before using sg_news, you need to supply your frontend some information on how the extension needs to be integrated into your template.
As the extension itself provides two new [doktypes](https://docs.typo3.org/typo3cms/CoreApiReference/PageTypes/Index.html), you can simply add a switch case to your Fluid template to provide different rendering paths.
### Example
```
```TypoScript
lib.pageTemplate.default >
lib.pageTemplate.default = FLUIDTEMPLATE
lib.pageTemplate.default {
...
...
@@ -83,57 +70,60 @@ lib.pageTemplate.default {
}
```
In this example we will load the first column for the intro section by default
In this example we will load the first column for the intro section by default,
and the second column in the backend for the content below that.
The news category (doktype 117) will render by default not the content on the page alone, but also the default category listing.
With our example we don't want the intro section (116) and the default content to be rendered, because the extension handles those parts.
With our example we don't want the intro section (116) and the default content to be rendered because the extension handles those parts.
The single news plugin also needs some additional information so it can get the base content.
By default it will resolve to the following code if not provided by you:
By default, it will resolve to the following code if not provided by you:
```
```TypoScript
lib.mainContent < styles.content.col1
```
### Example integration into your page template
Finally you need to output the **INTRO** and **CONTENT** variable in your page template:
<main>
<!--TYPO3SEARCH_begin-->
<f:if condition="{INTRO}">
<div class="intro-section">
{INTRO -> f:format.raw()}
{BREADCRUMB_MENU -> f:format.raw()}
</div>
</f:if>
<div class="main-content">
{CONTENT -> f:format.raw()}
</div>
<!--TYPO3SEARCH_end-->
</main>
Finally, you need to output the `INTRO` and `CONTENT` variable in your page template:
```HTML
<main>
<!--TYPO3SEARCH_begin-->
<f:if condition="{INTRO}">
<div class="intro-section">
{INTRO -> f:format.raw()}
{BREADCRUMB_MENU -> f:format.raw()}
</div>
</f:if>
<div class="main-content">
{CONTENT -> f:format.raw()}
</div>
<!--TYPO3SEARCH_end-->
</main>
```
### Implement author id mapping in TYPO3 9
To enable the author id mapping in TYPO3 9, you need to add this routeEnhancer configuration to your config.yaml.
```
```YAML
routeEnhancers:
NewsByAuthor:
type: Extbase
extension: SgNews
plugin: NewsByAuthor
routes:
- routePath: '/{authorTitle}'
_controller: 'NewsByAuthor::list'
_arguments: { 'authorTitle': authorId }
defaultController: 'NewsByAuthor::list'
aspects:
authorTitle:
type: PersistedAliasMapper
tableName: tx_sgnews_domain_model_author
routeFieldName: path_segment
NewsByAuthor:
type: Extbase
extension: SgNews
plugin: NewsByAuthor
routes:
- routePath: '/{authorTitle}'
_controller: 'NewsByAuthor::list'
_arguments: { 'authorTitle': authorId }
defaultController: 'NewsByAuthor::list'
aspects:
authorTitle:
type: PersistedAliasMapper
tableName: tx_sgnews_domain_model_author
routeFieldName: path_segment
```
### Tags
...
...
@@ -141,10 +131,10 @@ In addition to categories, multiple tags can be created and specified for each n
Tags can be created by adding sys_category records to the root page of the news block (blog).
In order to differentiate each block's tags from the others,
the PageTS value of **TCEFORM.pages.tx_sgnews_tags.PAGE_TSCONFIG_ID**
the PageTS value of `TCEFORM.pages.tx_sgnews_tags.PAGE_TSCONFIG_ID`
can be set for each of the blocks containing the pid value for the selectable tags.
To make sure that only the correct tags are displayed in the FE, the **plugin.tx_sgnews.settings.tagPid**
To make sure that only the correct tags are displayed in the FE, the `plugin.tx_sgnews.settings.tagPid`
constant must be set to the same value.
### Creating a news blog
...
...
@@ -157,44 +147,48 @@ On the next lower page level of each **Category** you can create pages of type *
On these pages you can use all your usual content elements to visualize your news entries belonging to the specific category.
### Plugins
General settings for the plugins can be found in the **Frontend/setup.txt** and **Frontend/constants.txt** TypoScript file:
General settings for the plugins can be found in the **Frontend/setup.typoscript** and **Frontend/constants.typoscript** files:
*setup.txt*
*setup.typoscript*
settings {
# Name of your site - required for the news.xml
siteName =
```TypoScript
settings {
# Name of your site - required for the news.xml
siteName =
# Your rootpage id - required for the news.xml to retrieve the base path
rootpageId = 1
# Your rootpage id - required for the news.xml to retrieve the base path
rootpageId = 1
# News limit (can be usually set also inside the flexforms)
# Uid of the page containing sys_category records used as tags
tagPid = {$plugin.tx_sgnews.settings.tagPid}
# Uid of the page containing sys_category records used as tags
tagPid = {$plugin.tx_sgnews.settings.tagPid}
# How to sort the news in general (date, positionInTree)
sortBy = date
}
# How to sort the news in general (date, positionInTree)
sortBy = date
}
```
*constants.txt*
*constants.typoscript*
settings {
newsLimitPerPage = 12
tagPid =
}
```TypoScript
settings {
newsLimitPerPage = 12
tagPid =
}
```
This extension comes with several plugins to display and categorize news:
###### News Overview
Provides an overview over all news. Additionally there is a tab navigation for groups of news.
Provides an overview over all news. Additionally, there is a tab navigation for groups of news.
Plugin options:
-**Group By**: By which aspect should your news be grouped in the tab navigation (none, category, tags)
-**News Limit**: The maximum amount news to be displayed. Further news can be displayed after the user clicks a button.
-**Only news within this page section**: Should only news from subpages be shown, or from all sites in this TYPO3 instance?
-**Only news within this page section**: Should only news from subpages be shown, or from all sites in this TYPO3 instance?
---
...
...
@@ -209,67 +203,76 @@ Plugin options:
-**Tags**: Here you can select which tags the news entries need to have to be shown here (If none are selected, all are shown).
---
###### News Single View
Provides a new page type **News** in the **Page Module**, that renders the content as a news element in the frontend.
---
###### News Feed
Provides a RSS Feed **news.xml** as a typenum. The typenum is defined in the **Frontend/setup.txt** and needs to be included in your TypoScript template:
# news feed as own page type
newsFeed = PAGE
newsFeed {
typeNum = 78906523
10 = USER
10 {
userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
extensionName = SgNews
pluginName = NewsFeed
vendorName = SGalinski
controller = NewsFeed
action = index
view < plugin.tx_sgnews.view
persistence < plugin.tx_sgnews.persistence
features < plugin.tx_sgnews.features
legacy < plugin.tx_sgnews.legacy
settings {
# if not provided all categories are shown
showCategories =
}
}
Provides an RSS Feed **news.xml** as a typenum. The typenum is defined in the **Frontend/setup.typoscript** and needs to be included in your TypoScript template:
```Typoscript
# news feed as own page type
newsFeed = PAGE
newsFeed {
typeNum = 78906523
10 = USER
10 {
userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
extensionName = SgNews
pluginName = NewsFeed
vendorName = SGalinski
controller = NewsFeed
action = index
view < plugin.tx_sgnews.view
persistence < plugin.tx_sgnews.persistence
features < plugin.tx_sgnews.features
legacy < plugin.tx_sgnews.legacy
settings {
# if not provided all categories are shown
showCategories =
}
}
config {
disableAllHeaderCode = 1
additionalHeaders = Content-type:text/xml
no_cache = 1
xhtml_cleaning = 0
}
}
```
config {
disableAllHeaderCode = 1
additionalHeaders = Content-type:text/xml
no_cache = 1
xhtml_cleaning = 0
}
}
---
###### PageBrowser
Automatically adds a pagination to the **News Overview** and **List News** plugins.
You find the settings in the **Fontend/constants.txt** configuration file:
You find the settings in the **Fontend/constants.typoscript** configuration file:
pagebrowser.settings {
# Number of page links to show before the current page
pagesBefore = 1
```Typoscript
pagebrowser.settings {
# Number of page links to show before the current page
pagesBefore = 1
# Number of page links to show before the current page
pagesAfter = 1
# Number of page links to show before the current page
pagesAfter = 1
# Enables section for "more" pages. This section is shown after links to next pages, normally like three dots (1 2 3 ...). Notice that you can also hide it by emptying corresponding template section.
enableMorePages = 1
# Enables section for "more" pages. This section is shown after links to next pages, normally like three dots (1 2 3 ...). Notice that you can also hide it by emptying corresponding template section.
enableMorePages = 1
# Enables section for "less" pages. This section is shown after links to next pages, normally like three dots (... 1 2 3) Notice that you can also hide it by emptying corresponding template section.
enableLessPages = 1
}
```
# Enables section for "less" pages. This section is shown after links to next pages, normally like three dots (... 1 2 3) Notice that you can also hide it by emptying corresponding template section.
enableLessPages = 1
}
---
###### addLike
Automatically adds an AJAX like button to each single news entry.
Make sure, that the extension **sg_ajax** is installed, otherwise this feature will be disabled.
Make sure that the extension **sg_ajax** is installed, otherwise this feature will be disabled.
If it should be like this, then make sure to remove this button from the sg_news default templates.