[TYPO3] CHC_Forum and RealUrl : nice URL's
Joost van Berckel
berckel at gmail.com
Fri Feb 16 17:05:14 CET 2007
Hello Typo3 list
I am implementing the CHC Forum extension in Typo3 version 4.0.4 with Real
Url. In less than one month from now we wish to launch our website for
future university students of the Delft University of Technology in the
Netherlands.
However I wish to rewrite the threads and posts in order to have a readable
urls, so we set-up the configuration of RealURL, see below.
// begin RealURL configuration
<?php
$TYPO3_CONF_VARS['SC_OPTIONS'] ['t3lib/class.t3lib_tstemplate.php']
['linkData-PostProc'] []
= 'EXT:realurl/class.tx_realurl.php:&tx_realurl->encodeSpURL';
$TYPO3_CONF_VARS['SC_OPTIONS'] ['tslib/class.tslib_fe.php']
['checkAlternativeIdMethods-PostProc'] []
= 'EXT:realurl/class.tx_realurl.php:&tx_realurl->decodeSpURL';
$TYPO3_CONF_VARS['SC_OPTIONS'] ['t3lib/class.t3lib_tcemain.php']
['clearAllCache_additionalTables'] ['tx_realurl_urldecodecache']
= 'tx_realurl_urldecodecache';
$TYPO3_CONF_VARS['SC_OPTIONS'] ['t3lib/class.t3lib_tcemain.php']
['clearAllCache_additionalTables'] ['tx_realurl_urlencodecache']
= 'tx_realurl_urlencodecache';
$TYPO3_CONF_VARS['FE'] ['addRootLineFields'] .=
',tx_realurl_pathsegment,alias,nav_title,title';
$TYPO3_CONF_VARS['EXTCONF']['realurl'] = array(
// Default host
'_DEFAULT' => array(
// General configuration
'init' => array(
'doNotRawUrlEncodeParameterNames' => 0,
'enableCHashCache' => 1,
'respectSimulateStaticURLs' => 1,
'appendMIssingSlash' => 1,
'adminJumpToBackend' => 0,
'enableUrlDecodeCache' => 1,
'enableUrlEncodeCache' => 1,
),
// Redirections
'redirects' => array(),
// Pre variables
'preVars' => array(
// No cache
array(
'GETvar' => 'no_cache',
'valueMap' => array(
'no_cache' => 1,
),
'noMatch' => 'bypass',
),
// Language
array(
'GETvar' => 'L',
'valueMap' => array(
'nl' => '0',
'en' => '1',
),
'valueDefault' => 'nl',
),
),
// Transformation method
'pagePath' => array(
'type' => 'user',
'userFunc' =>
'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
'spaceCharacter' => '-',
'languageGetVar' => 'L',
'expireDays' => 3,
),
// Fixed post variables
'fixedPostVars' => array(),
// Post variables
'postVarSets' => array(
'_DEFAULT' => array(
// CHC Forum
'vragen' => array(
array(
'GETvar' => 'view',
),
array(
'GETvar' => 'conf_uid',
'lookUpTable' => array(
'table' => 'tx_chcforum_conference',
'id_field' => 'uid',
'alias_field' => 'conference_name',
'addWhereClause' => ' AND NOT deleted',
'useUniqueCache' => 1,
'useUniqueCache_conf' => array(
'strtolower' => 1,
'spaceCharacter' => '-',
),
),
),
array(
'GETvar' => 'thread_uid',
'lookUpTable' => array(
'table' => 'tx_chcforum_thread',
'id_field' => 'uid',
'alias_field' => 'thread_subject',
'addWhereClause' => ' AND NOT deleted',
'useUniqueCache' => 1,
'useUniqueCache_conf' => array(
'strtolower' => 1,
'spaceCharacter' => '-',
),
),
),
array(
'GETvar' => 'cat_uid',
'lookUpTable' => array(
'table' => 'tx_chcforum_category',
'id_field' => 'uid',
'alias_field' => 'uid',
//'alias_field' => 'cat_title',
'addWhereClause' => ' AND NOT deleted',
'useUniqueCache' => 1,
'useUniqueCache_conf' => array(
'strtolower' => 1,
'spaceCharacter' => '-',
),
),
),
array(
'GETvar' => 'post_uid',
'lookUpTable' => array(
'table' => 'tx_chcforum_post',
'id_field' => 'uid',
//'alias_field' => 'post_subject',
'alias_field' => 'uid',
'addWhereClause' => ' AND NOT deleted',
'useUniqueCache' => 1,
'useUniqueCache_conf' => array(
'strtolower' => 1,
'spaceCharacter' => '-',
),
),
),
),
// end CHC Forum
),
),
// File names
'fileName' => array(
'index' => array(
'' => array(
'keyValues' => array(),
),
),
),
),
);
?>
// end RealURL
Now the URL looks like this:
Single tread :
http://scholierenlab-test.tudelft.nl/nl/forum/vragen/single_thread/wiskunde/reynoldsgetal/1/
All categories :
http://scholierenlab-test.tudelft.nl/nl/forum/vragen/all_cats/
Single conference:
http://scholierenlab-test.tudelft.nl/nl/forum/vragen/single_conf/wiskunde//1/
However I want to have:
Single tread :
http://scholierenlab-test.tudelft.nl/nl/forum/topic/wiskunde/reynoldsgetal/
All categories : http://scholierenlab-test.tudelft.nl/nl/forum/topiclist/ or
http://scholierenlab-test.tudelft.nl/nl/forum/
Single conference:
http://scholierenlab-test.tudelft.nl/nl/forum/topic/wiskunde/
We only have one forum category ("stel vragen aan de TU over je
profielwerkstuk"). Also we now have 2 times the word forum in the url. Can
you inform us how to leave all of this out of the url, or if it isn't
posible to leave it away how to put it as nice as possible.
Anybody?
Nice regards
Joost van Berckel
--------------------------
J.P.H. van Berckel
Software Developer
Shared Service Center ICT - 3xO
Delft University of Technology
J.P.H.vanBerckel at TUDelft.NL
Postbus 354
2600 AJ Delft
Landbergstraat 15
2628 CE Delft
Tel: +31 (0) 15 27 87384
Fax: +31 (0) 15 27 83787
Skype: callto://vanberckel
www.tudelft.nl
www.icto.tudelft.nl
www.e-merge.nu
More information about the TYPO3-english
mailing list