Skip to content

Instantly share code, notes, and snippets.

@markhowellsmead
Last active March 19, 2020 13:46
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markhowellsmead/98de3dbaaec2faf52e0863907b5e403e to your computer and use it in GitHub Desktop.
Save markhowellsmead/98de3dbaaec2faf52e0863907b5e403e to your computer and use it in GitHub Desktop.
Get news from TYPO3 via Ajax
// Ajax rendering of news: calls content element set in the backend to get content/settings
// Example call: http://domain.mhm/index.php?id=71&type=1479807984&recordUid=27
// Required params: id => page.uid, recordUid => tt_content.uid
// Returns the data in JSON format
// constants.txt
plugin.tx_news.settings.ajaxPageType = 1479807984
// setup.txt
plugin.tx_news.settings.ajaxPageType = {$plugin.tx_news.settings.ajaxPageType}
tx_frpnewsviaajax_pi1 = PAGE
tx_frpnewsviaajax_pi1 {
typeNum = {$plugin.tx_news.settings.ajaxPageType}
config {
disableAllHeaderCode = 1
xhtml_cleaning = 0
admPanel = 0
disablePrefixComment = 1
debug = 0
no_cache = 1
additionalHeaders = Content-type:application/json
}
10 = RECORDS
10 {
source.data = GP:recordUid
source.intval = 1
tables = tt_content
dontCheckPid = 1
conf.tt_content =< tt_content.list.20.news_pi1
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment