How to set Customize page title in news detail of typo3 + typoscript


 

How to set Customize page title in news detail of typo3 + typoscript

First of all we have to remove by default title tag.

Below script will remove title tag from source

config.noPageTitle = 2

After hiding of main title we can set news title as page title

Following script will help you for display page title.

This is only work when we have page id 72

[globalVar = TSFE:id = 72]

 newsTitle=COA
 newsTitle {
    5 = RECORDS
    5 {
        source = {GPvar:tx_ttnews|tt_news|tx_ttnews[tt_news]}
        source.insertData = 1
        tables = tt_news
        conf.tt_news >
        conf.tt_news = TEXT
        conf.tt_news.field=title
        wrap = <title>|</title>
    }
 }
page.headerData.5 < newsTitle

we can set condition based upon get parameter

[globalVar = _GET|tx_news_pi1|news > 0]

  config.noPageTitle = 2

  temp.newsTitle = RECORDS
  temp.newsTitle {
    dontCheckPid = 1
      tables = tx_news_domain_model_news
      source.data = GP:tx_news_pi1|news
      source.intval = 1
      conf.tx_news_domain_model_news = TEXT
      conf.tx_news_domain_model_news {
        field = title
        htmlSpecialChars = 1
      }
      wrap = |
  }
  page.headerData.1 >
  page.headerData.1 < temp.newsTitle

[global]

i hope it will work for you. 🙂

it will be good for SEO purpose

If you have any query then feel free to contact me at Jainish Senjaliya

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s