Skip to content

Instantly share code, notes, and snippets.

@paulrohrbeck
Last active January 2, 2016 01:19
Show Gist options
  • Save paulrohrbeck/8229332 to your computer and use it in GitHub Desktop.
Save paulrohrbeck/8229332 to your computer and use it in GitHub Desktop.
TYPO3, TypoScript: This little snippet changes the title tag for the news plugin (tx_news, not tx_ttnews) when just one page is used for the plugin, displaying both list and detail view. Without this the title would just be "Blog" (or whatever you set in the backend). Please note that for the single view you may use the built-in TitleTagViewHelp…

TYPO3, TypoScript: This little snippet changes the title tag for the news plugin (tx_news, not tx_ttnews) when just one page is used for the plugin, displaying both list and detail view. Without this the title would just be "Blog" (or whatever you set in the backend). Please note that for the single view you may use the built-in TitleTagViewHelper.

Results in:

  • Blog (main page)
  • Blog - page 2 (pagination, also see pagebrowse extension)
  • 12/2013 - Blog (Archive by month)
  • 12/2013 - page 2 - Blog
  • General - Blog (category)
  • General - page 2 - Blog (category)
# Show page number (used on all blog pages)
temp.blogTitle = COA
temp.blogTitle {
if.isTrue.data = GP:tx_news_pi1|@widget_0|currentPage
10 = TEXT
10 {
data = GP:tx_news_pi1|@widget_0|currentPage
intval = 1
htmlSpecialChars = 1
}
wrap =  - page |
}
# Blog List page (pagination)
[globalVar = GP:tx_news_pi1|@widget_0|currentPage > 0]
page.config.noPageTitle = 2
page.headerData.5 = COA
page.headerData.5 {
10 = TEXT
10.value = Blog
20 < temp.blogTitle
wrap = <title>|</title>
}
[global]
# Categories:
[globalVar = GP:tx_news_pi1|overwriteDemand|categories > 0]
temp.categoryTitle = RECORDS
temp.categoryTitle {
if.isTrue.data = GP:tx_news_pi1|overwriteDemand|categories
dontCheckPid = 1
tables = tx_news_domain_model_category
source.data = GP:tx_news_pi1|overwriteDemand|categories
source.intval = 1
conf.tx_news_domain_model_category = TEXT
conf.tx_news_domain_model_category {
field = title
htmlSpecialChars = 1
}
}
page.config.noPageTitle = 2
page.headerData.5 = COA
page.headerData.5 {
10 < temp.categoryTitle
20 < temp.blogTitle
wrap = <title> | &nbsp;- Blog</title>
}
page.10.variables.pageTitle < temp.categoryTitle
[global]
# Archive:
[globalVar = GP:tx_news_pi1|overwriteDemand|year > 0]
temp.archiveTitle = COA
temp.archiveTitle {
if.isTrue.data = GP:tx_news_pi1|overwriteDemand|year
10 = TEXT
10 {
data = GP:tx_news_pi1|overwriteDemand|month
intval = 1
htmlSpecialChars = 1
wrap = | /
}
20 = TEXT
20 {
data = GP:tx_news_pi1|overwriteDemand|year
intval = 1
htmlSpecialChars = 1
}
30 < temp.blogTitle
}
page.config.noPageTitle = 2
page.headerData.5 >
page.headerData.5 < temp.archiveTitle
page.headerData.5.wrap = <title> | &nbsp;- Blog</title>
page.10.variables.pageTitle < temp.archiveTitle
[global]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment