duminică, 29 mai 2011

TYPO3: Miscellaneous

Copyright notice with current year

H1, H2 si Typo3

Nu știu cît este de adevărat, dar cei care se ocupă de optimizarea pentru motoarele de căutare a paginilor web consideră că tag-urile H1 și H2 sînt foarte importante pentru Google și în plus tag-ul H1 trebuie apară doar o singură dată în pagina web, el fiind rezervat pentru titlul paginii.
Implicit în TYPO3 cîmpurile Header ale elementelor de conținut sînt încapsulate în tag-ul H1, respectiv dacă avem mai multe elemente de conținut pe pagină avem mai multe tag-uri H1.
Următoarea linie de TypoScript (plasată în secțiunea constants) face ca titlurile elementelor de conținut să fie plasate în tag-uri de tip H2.

content.defaultHeaderType = 2

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' => '-',
      ),
    ),
  ),
),