Newer
Older
<img src="https://www.sgalinski.de/typo3conf/ext/project_theme/Resources/Public/Images/logo.svg" />
License: [GNU GPL, Version 2](https://www.gnu.org/licenses/gpl-2.0.html)
Repository: https://gitlab.sgalinski.de/typo3/sg_news
Please report bugs here: https://gitlab.sgalinski.de/typo3/sg_news
TYPO3 version: >7.6
## About
Integrates a powerful News-System. News and Categories can be created like normal TYPO3 pages. Newspages have several
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
### Plugins
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.
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 ?
###### List News by Category/Tag
Lists all news from subpages for the given Categories / Tags.
Plugin options:
- **News Limit per Page**: The maximum amount of news to be shown.
- **Categories**: Here you can select which categories you want to be included (If none are selected, all are shown).
- **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**, that renders the content as a news element in the frontend.
###### News Feed
@todo
###### PageBrowser
@todo
###### addLike
Adds an AJAX like button to each single news entry.
Stefan Galinski
committed
## Integration
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
Stefan Galinski
committed
lib.pageTemplate.default >
Stefan Galinski
committed
lib.pageTemplate.default = FLUIDTEMPLATE
lib.pageTemplate.default {
Stefan Galinski
committed
file = EXT:project_theme/Resources/Private/Templates/Default.html
Stefan Galinski
committed
INTRO = CASE
INTRO {
key.field = doktype
# show nothing for the intro view as sg_news provides it's own default intro section
116 = TEXT
116.value =
Stefan Galinski
committed
117 = COA
117 {
10 < tt_content.list.20.sgnews_latest
20 < styles.content.col0
}
Stefan Galinski
committed
# just show the content
default < styles.content.col0
}
CONTENT = CASE
Stefan Galinski
committed
key.field = doktype
# show the single view of a news article if the page type matches
116 < tt_content.list.20.sgnews_singleview
# show the category view of the news if the page type matches
Stefan Galinski
committed
117 = COA
117 {
10 < tt_content.list.20.sgnews_listbycategory
20 < styles.content.col1
}
Stefan Galinski
committed
# just show the content
default < styles.content.col1
Stefan Galinski
committed
```
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.
Stefan Galinski
committed
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:
Stefan Galinski
committed
```
lib.mainContent < styles.content.col1
```
### Tags
In addition to categories, multiple tags can be created and specified for each news page.
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**
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**
constant must be set to the same value.
### Creating a news blog
Add the plugin **News Overview** and optionally the plugin **Latest News** to a standard TYPO3 page.
After that you must create sites of type **Category** sites below the blog page level and name them accordingly.
On the next lower page level of each **Category** you can create pages of type **News**.
On these pages you can use all your usual content elements to visualize your news entries belonging to the specific category.