Skip to content

Instantly share code, notes, and snippets.

@christianhaendel
Last active August 29, 2015 14:13
Show Gist options
  • Save christianhaendel/ebd6544d524e99570555 to your computer and use it in GitHub Desktop.
Save christianhaendel/ebd6544d524e99570555 to your computer and use it in GitHub Desktop.
Setup Prev Next Link in TYPO3 ext:news languageBased with Typoscript
<!-- Example Fluid Part -->
<f:cObject typoscriptObjectPath="lib.prevLink" data="{newsItem.categories.0.uid}"/>
<h2>{newsItem.title}</h2>
<f:cObject typoscriptObjectPath="lib.nextLink" data="{newsItem.categories.0.uid}"/>
lib.currentNewsPid = RECORDS
lib.currentNewsPid {
tables = tx_news_domain_model_news
dontCheckPid = 1
source.data = GP:tx_news_pi1|news
conf.tx_news_domain_model_news = TEXT
conf.tx_news_domain_model_news.field = pid
}
lib.nextLink = CONTENT
lib.nextLink {
table = tx_news_domain_model_news
select {
pidInList.cObject < lib.currentNewsPid
orderBy = uid ASC
languageField = sys_language_uid
join = sys_category_record_mm ON sys_category_record_mm.uid_foreign=tx_news_domain_model_news.uid
where.cObject = TEXT
where.cObject.current = 1
where.cObject.required = 1
where.cObject.wrap = sys_category_record_mm.uid_local=|
andWhere = uid > {GP:tx_news_pi1|news}
andWhere.insertData = 1
max = 1
}
renderObj = TEXT
renderObj {
value = nächster Artikel
typolink.parameter.data = TSFE:id
typolink.additionalParams = &tx_news_pi1[news]={field:uid}
typolink.additionalParams.insertData = 1
}
}
lib.prevLink < lib.nextLink
lib.prevLink {
select {
orderBy = uid DESC
languageField = sys_language_uid
andWhere = uid < {GP:tx_news_pi1|news}
}
renderObj.value = vorheriger Artikel
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment