Skip to content

Instantly share code, notes, and snippets.

@PeterTheOne
Last active August 29, 2015 14:03
Show Gist options
  • Save PeterTheOne/d7108ee38cfb5ff6b232 to your computer and use it in GitHub Desktop.
Save PeterTheOne/d7108ee38cfb5ff6b232 to your computer and use it in GitHub Desktop.
TYPO3 News filter by date range with timeRestriction and timeRestrictionHigh
temp.news = USER
temp.news {
userFunc = tx_extbase_core_bootstrap->run
extensionName = News
pluginName = Pi1
switchableControllerActions.News.1 = list
settings < plugin.tx_news.settings
view {
templateRootPath = fileadmin/templates/News/Templates/
partialRootPath = fileadmin/templates/News/Partials/
layoutRootPath = fileadmin/templates/News/Layouts/
}
settings {
startingpoint = 28
detailPid = 41
limit = 1
overrideFlexformSettingsIfEmpty := addToList(detailPid)
cropMaxCharacters = 150 | ... | 1
excludeAlreadyDisplayedNews = 1
}
}
30 = COA
30 {
wrap = <h4>2014</h4>|
1 < temp.news
1.view.partialRootPath = fileadmin/templates/News/Partials_pressArchive/
1.settings {
startingpoint = 51
detailPid = 85
limit = 30
timeRestriction = 01.01.2014
timeRestrictionHigh = 31.12.2014
}
}
@ahramcov
Copy link

Hello. Thanks for example. Tell me plz, how can I set "timeRestriction" and "timeRestrictionHigh" from url params?
?dateFrom=01.01.2014&dateTo=31.12.2014

@ahramcov
Copy link

Sloved:
Get params tx_news_pi1[overwriteDemand][timeRestriction] and tx_news_pi1[overwriteDemand][timeRestrictionHigh]

For page url's like "http://example.com/news_by_date_range/01.01.2014/31.12.2014/"
In RealURL conf:
'fixedPostVars' => array(
//...
'newsDateFilter' => array(
array(
'GETvar' => 'tx_news_pi1[overwriteDemand][timeRestriction]',
),
array(
'GETvar' => 'tx_news_pi1[overwriteDemand][timeRestrictionHigh]',
),
),
'35' => 'newsDateFilter', //replace 35 to news-list page uid
//...
),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment