duminică, 29 mai 2011

TYPO3: tt_news & realurl

LIST & SINGLE on the same page

Add News content element to the page you want to mix the LIST and SINGLE view mode. You can change plugin configuration how you want except the What to display setting (found on General Settings tab); from the What to display list, select Defined by TypoScript.

On the same page create an extension template with the following setup

# clear the code field
plugin.tt_news.code >
plugin.tt_news.code = LIST
# prevent indexing of the LIST view
config.index_enable = 0

[globalVar = GP:tx_ttnews|tt_news > 0]
plugin.tt_news.code = SINGLE
# enable indexing of the SINGLE view
config.index_enable = 1
[global]

News Category + News ID in the URL

It is possible to change the URL for news to look like those from BBC News without extra PHP coding. It is enought to change the configuration of the RealURL.

'article' => array(
  array => (
    'GETvar' => 'tx_ttnews[tt_news]',
    'lookUpTable' => array(
      'table' => 'tt_news, tt_news_cat, tt_news_cat_mm',
      'id_field' => 'uid_local',
      'alias_field' => 'CONCAT(tt_news_cat.title," ",uid_local)',
      'addWhereClause' => ' AND NOT tt_news.deleted AND tt_news.uid = uid_local AND tt_news_cat.uid = uid_foreign',
      'useUniqueCache' => 1,
      'useUniqueCache_conf' => array(
        'strtolower' => 1,
        'spaceCharacter' => '-',
      ),
    ),
  ),
),

Niciun comentariu:

Trimiteți un comentariu