[TYPO3] CHC_Forum and RealUrl : nice URL's

Joost van Berckel berckel at gmail.com
Wed Feb 21 17:42:29 CET 2007


Hello Ralph,

Thank you very much for your response. I have changed the config of realurl 
with your code, however without success, see 
http://scholierenlab-test.tudelft.nl/nl/forum/. The url's are nicer, but why 
do I get forum/0/topic/ etc? Clicking on any url (thread, topic or search 
or...) results in error 404... Below you can find the Realurl configuration. 
I think we are close to the solution.

Real URL
// start

<?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',
    //'noMatch' => 'bypass',
   ),
  ),
  // 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(
  // CHC forum weghalen /vragen/
   '79'=> $forumconfig,
  ),

  // Post variables
  'postVarSets' => array(
   '_DEFAULT' => array(
    // CHC Forum

$forumconfig = array (
        array ( 'GETvar' => 'view',
                'valueMap' => array (
                        'search' => 'search',
                        'main' => 'all_cats',
                        'topic' => 'single_conf',
                        'thread' => 'single_thread',
                        'profile' => 'profile',
                        'users' => 'ulist',
                        'category' => 'single_cat',
                        'pm' => 'cwt_user_pm',
                        'buddylist' => 'cwt_buddylist',
                        'reply' => 'single_post',
                ),
        ),
        array ( 'cond' => array (
                        'prevValueInList' => 'profile'
                ),
                'GETvar' => 'author'
        ),
        array ( 'cond' => array (
                        'prevValueInList' => 'single_post,quote'
                ),
                'GETvar' => 'post_uid',
        ),
        array (
                'GETvar' => 'page',
                'noMatch' => 'bypass',
        ),
        array ( 'GETvar' => 'cat_uid',
                'lookUpTable' => array (
                        'table' => 'tx_chcforum_category',
                        'id_field' => 'uid',
                        'alias_field' => 'cat_title',
                        'addWhereClause' => ' AND NOT deleted',
/* other stuff might follow here; e.g */
                        'useUniqueCache' => 1,
                        'useUniqueCache_conf' => array (
                                'strtolower' => 1,
                                'spaceCharacter' => '-'
                        ),
                        'autoUpdate' => 1,
                        'expireDays' => '14'
                ),
        ),
        array ( 'GETvar' => 'conf_uid',
                'lookUpTable' => array (
                        'table' => 'tx_chcforum_conference',
                        'id_field' => 'uid',
                        'alias_field' => 'conference_name',
                        'addWhereClause' => ' AND NOT deleted',
/* other stuff might follow here */
                ),
        ),
        array ( 'GETvar' => 'thread_uid',
                'lookUpTable' => array (
                        'table' => 'tx_chcforum_thread',
                        'id_field' => 'uid',
                        'alias_field' => 'thread_subject',
                        'addWhereClause' => ' AND NOT deleted',
/* other stuff might follow here */
                ),
        ),
),



    // end CHC Forum
   ),
  ),
  // File names
  'fileName' => array(
   'index' => array(
    '' => array(
     'keyValues' => array(),
    ),
   ),
  ),
 ),
);
?>

// end

Thank you for your kind help,

nice regards

Joost van Berckel

"Ralf Hettinger" <ng at ralfhettinger.de> wrote in message 
news:mailman.1.1171983116.27345.typo3-english at lists.netfielders.de...
> Hi Joost,
>
> Joost van Berckel schrieb:
>> 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/
>
> That's not that bad already, is it? Some more ideas follow...
>
>
>> 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/
>
> To get rid of 'vragen' switch to fixedPostVars. That should not be a 
> problem,
> since the chc normally resides on a certain page:
>
> [...]
> 'fixedPostVars' => array(
>  '[pid with forum plugin]' => $forumconfig,
> ),
> [...]
>
>
> Secondly, to have an individual fit of single_thread etc. use valueMap
>
> At last, there are some things for viewing the profile etc. that should be
> considered... following an example for $forumconfig (not everthing you 
> mentioned
> is probably possible without some more dramatic source code changes; e.g. 
> single
> conference and single thread need other view params - but maybe the 
> following
> can deliver a compromise)
>
>
> $forumconfig = array (
>        array ( 'GETvar' => 'view',
>                'valueMap' => array (
>                        'search' => 'search',
>                        'main' => 'all_cats',
>                        'topic' => 'single_conf',
>                        'thread' => 'single_thread',
>                        'profile' => 'profile',
>                        'users' => 'ulist',
>                        'category' => 'single_cat',
>                        'pm' => 'cwt_user_pm',
>                        'buddylist' => 'cwt_buddylist',
>                        'reply' => 'single_post',
>                ),
>        ),
>        array ( 'cond' => array (
>                        'prevValueInList' => 'profile'
>                ),
>                'GETvar' => 'author'
>        ),
>        array ( 'cond' => array (
>                        'prevValueInList' => 'single_post,quote'
>                ),
>                'GETvar' => 'post_uid',
>        ),
>        array (
>                'GETvar' => 'page',
>                'noMatch' => 'bypass',
>        ),
>        array ( 'GETvar' => 'cat_uid',
>                'lookUpTable' => array (
>                        'table' => 'tx_chcforum_category',
>                        'id_field' => 'uid',
>                        'alias_field' => 'cat_title',
>                        'addWhereClause' => ' AND NOT deleted',
> /* other stuff might follow here; e.g */
>                        'useUniqueCache' => 1,
>                        'useUniqueCache_conf' => array (
>                                'strtolower' => 1,
>                                'spaceCharacter' => '-'
>                        ),
>                        'autoUpdate' => 1,
>                        'expireDays' => '14'
>                ),
>        ),
>        array ( 'GETvar' => 'conf_uid',
>                'lookUpTable' => array (
>                        'table' => 'tx_chcforum_conference',
>                        'id_field' => 'uid',
>                        'alias_field' => 'conference_name',
>                        'addWhereClause' => ' AND NOT deleted',
> /* other stuff might follow here */
>                ),
>        ),
>        array ( 'GETvar' => 'thread_uid',
>                'lookUpTable' => array (
>                        'table' => 'tx_chcforum_thread',
>                        'id_field' => 'uid',
>                        'alias_field' => 'thread_subject',
>                        'addWhereClause' => ' AND NOT deleted',
> /* other stuff might follow here */
>                ),
>        ),
> );
>
>
>
> Cheers Ralf 




More information about the TYPO3-english mailing list