tt_news news category as page title



 

Here's how to display the currently selected tt_news category as the page title.

The following typoscript, will replace the text in the <title> tag with the category corresponding to the tx_ttnews[cat] url parameter.

  1. # Make the title the same as the tt_news title #
  2.  
  3. config.noPageTitle = 1
  4.  
  5. temp.newsTitle = COA
  6.  
  7. temp.newsTitle {
  8.  
  9. 10 = RECORDS
  10.  
  11. 10 {
  12.  
  13.   source = {GPvar:tx_ttnews|cat}
  14.  
  15.   source.insertData = 1
  16.  
  17.   tables = tt_news_cat
  18.  
  19.   conf.tt_news_cat >
  20.  
  21.   conf.tt_news_cat = TEXT
  22.  
  23.   conf.tt_news_cat.field = title
  24.  
  25. }
  26.  
  27. }
  28.  
  29. temp.newsTitle.wrap = <title>|</title>
  30.  
  31. page.headerData.10 < temp.newsTitle

Also, you may find it necessary sometimes to include a condition so that the above code only gets called if the parameter tx_ttnews|cat is present. You would modify the above typoscript snippet slightly as follows.

  1. [globalVar = GP:tx_ttnews|cat > 0]
  2.  
  3. # Make the title the same as the tt_news title #
  4.  
  5. config.noPageTitle = 1
  6.  
  7. temp.newsTitle = COA
  8.  
  9. temp.newsTitle {
  10.  
  11. 10 = RECORDS
  12.  
  13. 10 {
  14.  
  15.   source = {GPvar:tx_ttnews|cat}
  16.  
  17.   source.insertData = 1
  18.  
  19.   tables = tt_news_cat
  20.  
  21.   conf.tt_news_cat >
  22.  
  23.   conf.tt_news_cat = TEXT
  24.  
  25.   conf.tt_news_cat.field = title
  26.  
  27. }
  28.  
  29. }
  30.  
  31. temp.newsTitle.wrap = <title>|</title>
  32.  
  33. page.headerData.10 < temp.newsTitle
  34.  


vcvcvcvc, 24-08-10 10:06:
cvcvcvcv

Add comment

* - required field

*

CAPTCHA image for SPAM prevention
If you can't read the word, click here.
*
*
 

Netdip.com is an excellent web site that's powered by TYPO3 and other great open source software. Netdip.com is also a fat free alternative to ice cream.