0
votes

I have couple of tt_news category items and subpages on which these categories belong, for example:

  • www.example.com/typo3/category/typoscript.html - id=1
  • www.example.com/other/category/seo.html - id=2

I have following TS who "connect" page title and category name:

[globalVar = TSFE:id = 1]
temp.newsTitle = RECORDS
temp.newsTitle {
  source = {GP:tx_ttnews|cat}
  source.insertData = 1
  tables = tt_news_cat
  conf.tt_news_cat >
  conf.tt_news_cat = TEXT
  conf.tt_news_cat.field=title
  wrap = <title>TYPO3 -|</title>
}
page.config.noPageTitle = 2
page.headerData.30 >
page.headerData.30 < temp.newsTitle
[global]


[globalVar = TSFE:id = 2]
temp.newsTitle = RECORDS
temp.newsTitle {
  source = {GP:tx_ttnews|cat}
  source.insertData = 1
  tables = tt_news_cat
  conf.tt_news_cat >
  conf.tt_news_cat = TEXT
  conf.tt_news_cat.field=title
  wrap = <title>Other -|</title>
}
page.config.noPageTitle = 2
page.headerData.30 >
page.headerData.30 < temp.newsTitle
[global]

In output the title of pages looks like this:

  • TYPO3 - TypoScript
  • Other - SEO

Is it possible to connect those two values globally (without globalVar = TSFE:id = 3)?

I try with these but it didn't work:

[globalVar = GP:tx_ttnews|cat > 0]
lib.newsTitle = COA
lib.newsTitle {

10 = TEXT
10.field = title
10.noTrimWrap = ||: |

20 = RECORDS
20 {
  source = {GP:tx_ttnews|cat}
  source.insertData = 1
  tables = tt_news_cat
  conf.tt_news_cat >
  conf.tt_news_cat = TEXT
  conf.tt_news_cat.field=title
}
wrap = <title>|</title>
}

page.config.noPageTitle = 2
page.headerData.30 >
page.headerData.30 < temp.newsTitle  
[global]
1
You seem to be building a category tree by hand. Is there a reason you're not using subcategories? (and the more up to date ext:news?)Urs
It is more clean (for me) and I can control what to put on site. I will be move to ext:news but it takes time (and I like tt_news :P)Adrian

1 Answers

1
votes

What about insertData in the wrap?

    temp.newsTitle = RECORDS
    temp.newsTitle {
      source = {GP:tx_ttnews|cat}
      source.insertData = 1
      tables = tt_news_cat
      conf.tt_news_cat >
      conf.tt_news_cat = TEXT
      conf.tt_news_cat.field=title
      stdWrap.wrap = <title>{page:title} -|</title>
      stdWrap.insertData = 1
    }

If it works, maybe even try without stdWrap.