[TYPO3-ttnews] How to get rid of "Article" in realURL-PostvarSets?
Tomas Mrozek
mail at cascaval.com
Wed Apr 11 11:39:51 CEST 2007
> RealUrl needs the 'article' segment of the URI as a hook to process the
> encoding and decoding of the tt_news article URIs.
Actually, it's possible to use fixedPostVars instead of postVarSets and
then realurl doesn't need the 'article' keyword.
Sample URLs:
------------
http://www.mydomain.com/page_name/article_title/ - single view
http://www.mydomain.com/page_name/number/ - list/latest view with page
numbers
Sample config (localconf.php):
-----------------------------------------------------------------------
// RealURL - fixedPostVars settings for tt-news
$TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT'] = array(
// ... other directives...
'fixedPostVars' => array(
'news' => array(
array(
'GETvar' => 'tx_ttnews[pointer]',
'valueMap' => array(),
'noMatch' => 'bypass',
),
array(
'GETvar' => 'tx_ttnews[tt_news]',
'lookUpTable' => array(
'table' => 'tt_news',
'id_field' => 'uid',
'alias_field' => 'title',
'addWhereClause' => ' AND NOT deleted',
'useUniqueCache' => 1,
'useUniqueCache_conf' => array(
'strtolower' => 1,
'spaceCharacter' => '-',
),
'languageGetVar' => 'L',
'languageExceptionUids' => '',
'languageField' => 'sys_language_uid',
'transOrigPointerField' => 'l18n_parent',
'autoUpdate' => 1,
'expireDays' => 180,
),
),
),
),
// ... other directives...
);
// RealURL - valueMap creation for tt-news
for($x=1; $x<=100; $x++) {
$TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT']['fixedPostVars']['news'][0]['valueMap'][$x+1]
= $x;
}
// RealURL - page definition for tt_news
$TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT']['fixedPostVars']['id_of_the_page_showing_news']
= 'news';
-----------------------------------------------------------------------
Beware, it might not suit everybody's needs and it has some drawbacks:
- the articles cannot have a number from 1 to 100 as a title
- you have to add each page that displays news into localconf.php
- no backpid
Tomas Mrozek
More information about the TYPO3-project-tt-news
mailing list