Skip to content
Snippets Groups Projects
Commit 5847761b authored by Kevin von Spiczak's avatar Kevin von Spiczak
Browse files

Merge branch 'feature_3325-xml-news-feed' into 'master'

Feature 3325 xml news feed

See merge request !29
parents b91a231a 7b395e07
No related branches found
No related tags found
1 merge request!29Feature 3325 xml news feed
......@@ -46,10 +46,11 @@ class NewsFeedController extends AbstractController {
*/
public function indexAction() {
$categories = GeneralUtility::intExplode(',', $this->settings['showCategories'], TRUE);
$tags = GeneralUtility::intExplode(',', $this->settings['showTags'], TRUE);
$startTime = (int) $this->settings['starttime'];
$endTime = (int) $this->settings['endtime'];
$news = $this->newsRepository->findLastUpdatedOrHighlightedNewsByCategories(
10, FALSE, $categories, 0, FALSE, 'date', NULL, $startTime, $endTime
10, FALSE, $categories, 0, FALSE, 'date', $tags, $startTime, $endTime
);
$this->view->assign('news', $news);
}
......
......@@ -16,17 +16,27 @@ newsFeed {
features < plugin.tx_sgnews.features
legacy < plugin.tx_sgnews.legacy
settings {
# if not provided all categories are shown
# PIDs of news category pages (page doktype, not to be confused with actual sys_category records!!!)
# If not provided, news of all categories are shown
showCategories =
# UIDs of sys_category records, assigned to a news record in `tx_sgnews_tags`
# If not provided, news of all tags are shown
showTags =
}
}
config {
disableAllHeaderCode = 1
additionalHeaders = Content-type:text/xml
disableCharsetHeader = 1
no_cache = 1
xhtml_cleaning = 0
index_enable = 0
additionalHeaders {
10 {
header = Content-Type:text/xml
replace = 0
}
}
}
}
......
......@@ -232,19 +232,40 @@ newsFeed {
features < plugin.tx_sgnews.features
legacy < plugin.tx_sgnews.legacy
settings {
# if not provided all categories are shown
# PIDs of news category pages (page doktype, not to be confused with actual sys_category records!!!)
# If not provided, news of all categories are shown
# Please separate multiple PIDs with a comma.
showCategories =
# UIDs of sys_category records, assigned to a news record in `tx_sgnews_tags`
# If not provided, news of all tags are shown
# Please separate multiple UIDs with a comma.
showTags =
}
}
config {
disableAllHeaderCode = 1
additionalHeaders = Content-type:text/xml
disableCharsetHeader = 1
no_cache = 1
xhtml_cleaning = 0
index_enable = 0
additionalHeaders {
10 {
header = Content-Type:text/xml
replace = 0
}
}
}
}
```
If you need multiple news feeds with different content, you can duplicate the provided configuration and modify the typenum & parameters like showCategories / showTags:
```Typoscript
myOtherNewsFeed < newsFeed
myOtherNewsFeed.typeNum = ENTER_YOUR_TYPENUM_HERE
myOtherNewsFeed.10.settings.showCategories =
myOtherNewsFeed.10.settings.showTags =
```
---
###### PageBrowser
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment