Translations
Info
All page names need to be in English.
en da  de  fr  it  ja  km  nl  ru  zh

Realurl/examples

From TYPO3Wiki
Jump to: navigation, search

<< Back to Extension manuals page

[edit]

Other RealURL topic: testing | manual in the Wiki | a project to write a configuration editor for RealURL


Example for realUrl-Config

media:LocalConf_realUrl.txt



Comprock

--Liouma 08:35, 23 Feb 2005 (CET)

  • realUrl with
    • language menu
    • nice url for glossary, fotoboek, printlink extensions
    • news only on certain pages
    • path caching disabled
    • 2 sites with different language choices

Works fine only if disablePathCache options is true.

PHP script:
 <?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,title';
 
 // realurl config
 $TYPO3_CONF_VARS['EXTCONF']['realurl'] = array(
 // spanish subsite with basque & catalan
 'espana.tokitsu.com' => array(
 		'init' => array(
 			'enableCHashCache' => 1, 
 			// 'appendMissingSlash' => 'ifNotFile',
 			'enableUrlDecodeCache' => 1,
 			'enableUrlEncodeCache' => 1,
 			),
 		'redirects' => array(
 			),
 		'preVars' => array(
 			array(
 				'GETvar' => 'no_cache',
 				'valueMap' => array(
 					'nc' => 1,
 					),
 				'noMatch' => 'bypass',
 				),
 			array(
 				'GETvar' => 'L',
 				'valueMap' => array(
 					'es' => '1',
 					'eu' => '6', 
 					'ca' => '7',
 					),
 				//'noMatch' => 'bypass',
 				'valueDefault' => 'es',
 				),
 			),
 
 		// use extended page name rendering
 		// page names are converted to readalbe page/sub-page/sub-sub-page.html
 		'pagePath' => array(
 			'type' => 'user',
 			'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
 			'spaceCharacter' => '-',
 			'languageGetVar' => 'L',
 			'expireDays' => 3,
 			'rootpage_id' => 67,
 			'disablePathCache' => '1',
 			// 'encodeTitle_userProc'=>'EXT:realurl/tx_realurl_encodeTitle_userProc.php:&user_encodeDates',
 			),
 		'fixedPostVars' => array(
 		),
 
 	'fileName' => array(
 		'index' => array(
 			//ajout pour printlink :
 			'print.html' => array(
 				'keyValues' => array(
 					type => 98,
 					)
 				),
 			),
 		'_DEFAULT' => array(
 			'keyValues' => array(
 				)
 			),
 		// add .html suffix to the end of the path generated
 		'defaultToHTMLsuffixOnPrev' => 1,
 		),
 	),
 //#########################################################################################################################
 //
 		'www.tokitsu.com' => array(
 		'init' => array(
 			'enableCHashCache' => 1, 
 			// 'appendMissingSlash' => 'ifNotFile',
 			'enableUrlDecodeCache' => 1,
 			'enableUrlEncodeCache' => 1,
 			),
 		'redirects' => array(
 			),
 		'preVars' => array(
 			array(
 				'GETvar' => 'no_cache',
 				'valueMap' => array(
 					'nc' => 1,
 					),
 				'noMatch' => 'bypass',
 				),
 			array(
 				'GETvar' => 'L',
 				'valueMap' => array(
 					'fr' => '0',
 					'es' => '1',
 					'en' => '2', 
 					'it' => '3', 
 					'jp' => '4', 
 					'pt' => '5', 
 					'eu' => '6', 
 					'ca' => '7',
 					),
 				'noMatch' => 'bypass',
 				),
 			),
 
 		// use extended page name rendering
 		// page names are converted to readalbe page/sub-page/sub-sub-page.html
 		'pagePath' => array(
 			'type' => 'user',
 			'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
 			'spaceCharacter' => '-',
 			'languageGetVar' => 'L',
 			'expireDays' => 3,
 			'rootpage_id' => 13,
 			'disablePathCache' => '1', 
 			// 'encodeTitle_userProc'=>'EXT:realurl/tx_realurl_encodeTitle_userProc.php:&user_encodeDates',
 			),
 		'fixedPostVars' => array(
 		),
 
 	'postVarSets' => array(
 		//tt_news 		
 		'964' => array(
 			// archive
 			'period' => array(
 				array(
 					'condPrevValue' => -1,
 					'GETvar' => 'tx_ttnews[pS]' , 
 					'valueMap' => array(
 						)
 					),
 				array(
 					'GETvar' => 'tx_ttnews[pL]' , 
 					'valueMap' => array(
 						)
 					),
 				array(
 					'GETvar' => 'tx_ttnews[arc]' ,
 					'valueMap' => array(
 						'archived' => 1,
 						'non-archived' => -1,
 						)
 					),
 				),
 
 			// pagebrowser
 			'browse' => array(
 				array(
 					'GETvar' => 'tx_ttnews[pointer]',
 					),
 				),
 			'select' => array (
 				array(
 					'GETvar' => 'tx_ttnews[cat]',
 					'lookUpTable' => array(
 						'table' => 'tt_news_cat',
 						'id_field' => 'uid',
 						'alias_field' => 'title',
 						'addWhereClause' => ' AND NOT deleted',
 						'useUniqueCache' => 1,
 						'useUniqueCache_conf' => array(
 							'strtolower' => 1,
 							),
 						),
 					),
 				),
 
 			'article' => array(
 				array(
 					'GETvar' => 'tx_ttnews[backPid]',
 					),
 				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' => '-',
 							),
 						),
 					),
 				array(
 					'GETvar' => 'tx_ttnews[swords]'
 					),
 				),
 			),
 		'466' => '964',
 		'465' => '964',
 		'467' => '964',
 		'468' => '964',
 		//Glossaire :
 		'228' => array(
 
 			       // glossaire
 			       'lex' => array(
 					      array(
 						    'GETvar' => 'range' ,
 						    'valueMap' => array(
                                                 )
 						    ),
 					      array(
 						    'GETvar' => 'lex' ,
 						    'valueMap' => array(
                                                 )
 						    ),
 
 
 					      array(
 						    'GETvar' => 'cHash' ,
 						    'valueMap' => array(
                                                 )
 						    ),
 					      ),
 			       ),
 		'227' => '228',
 		//links
 		'223'  => array(
  		        // links
 		    'links' => array(
 			     array(
 				   'GETvar' => 'action' ,
 		     		   'valueMap' => array(
 						       //'add' => 'getviewaddnewlink',
 						       //'viewcat' => 'getviewcategory'
                                         )
 				   ),
 				   array(
 					 'GETvar' => 'category_uid',
                                      'valueMap' => array(
                                      )
                                   ),
 
 		    ),
 		    ),
 		//Photobooks simples :
 		'1228' => array(
 			 //photos sensei
 		         'photo' => array(
 				 array(
 				       'GETvar' => 'tx_gooffotoboek_pi1_fid',
 				       'valueMap' => array(
                                                 )
 				       ),
 				 array(
 				       'GETvar' => 'tx_gooffotoboek_pi1_func' ,
 				       'valueMap' => array(
                                                  )
 				       ),
 				 ),
 			 ),
 		//kiko
 		'329' => '1228',
 		//danse
 		'353' => '1228',
                 //Photobooks avec arbo :
                 '178' => array(
 				'photo' => array(
 array(
 						 'GETvar' => 'tx_gooffotoboek_pi1_srcdir',
 						 'valueMap' => array(
 						   )
 						 ),
 
 						 array(
 						       'GETvar' => 'tx_gooffotoboek_pi1_fid',
 						       'valueMap' => array(
                                                 )
 						       ),
 						 array(
 						       'GETvar' => 'tx_gooffotoboek_pi1_func' ,
 						       'valueMap' => array(
                                                  )
 						       ),
 						 ),
 				),
 		//taichi
 		'345' => '178',
        		'_DEFAULT' => array(
                               ),
                 ),
 
 	'fileName' => array(
 		'index' => array(
 			//ajout pour printlink :
 			'print.html' => array(
 				'keyValues' => array(
 					type => 98,
 					)
 				),
 			),
 		'_DEFAULT' => array(
 			'keyValues' => array(
 				)
 			),
 		// add .html suffix to the end of the path generated
 		'defaultToHTMLsuffixOnPrev' => 1,
 		),
 	),
 //#########################################################################################################################
 	'_DEFAULT' => array(
 		'init' => array(
 			'enableCHashCache' => 1, 
 			// 'appendMissingSlash' => 'ifNotFile',
 			'enableUrlDecodeCache' => 1,
 			'enableUrlEncodeCache' => 1,
 			),
 		'redirects' => array(
 			),
 		'preVars' => array(
 			array(
 				'GETvar' => 'no_cache',
 				'valueMap' => array(
 					'nc' => 1,
 					),
 				'noMatch' => 'bypass',
 				),
 			),
 
 		'fixedPostVars' => array(
 		),
 
 	'fileName' => array(
 		'index' => array(
 			//ajout pour printlink :
 			'print.html' => array(
 				'keyValues' => array(
 					type => 98,
 					)
 				),
 			),
 		'_DEFAULT' => array(
 			'keyValues' => array(
 				)
 			),
 		// add .html suffix to the end of the path generated
 		'defaultToHTMLsuffixOnPrev' => 1,
 		),
 		),
 
 );



-- Dennis S. Hennen 08:49, 13 May 2006 (EST)

  • realUrl with lz_gallery support (for simple layout)
    • Gallery title is used in the URL
    • Sub-galleries and effects untested
    • Much room for improvement
    • Live example at EliseAndDennis.org
PHP script:
 $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['FE']['pageNotFound_handling'] = 'READFILE:fileadmin/templates/pagenotfound.html';
 
 $TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT'] = array(
    'init' => array(
        'enableCHashCache' => 1,
        'enableUrlDecodeCache' => 1,
        'enableUrlEncodeCache' => 1,
        'appendMissingSlash' => 'ifNotFile',
    ),
    'redirects' => array (
    ),
    'rewrite' => array(
    ),
    'preVars' => array (
        '0' => array (
            'GETvar' => 'no_cache',
            'valueMap' => array (
                'nc' => '1'
             ),
            'noMatch' => 'bypass'
        ),
        '1' => array (
            'GETvar' => 'L',
            'valueMap' => array (
                 'dk' => '2',
                 'de' => '1',
            ),
            'noMatch' => 'bypass',
        ),
    ),
    // use extended page name rendering                                                                                                                               
    // page names are converted to readable page/sub-page/sub-sub-page.html                                                                                           
    'pagePath' => array(
        'type' => 'user',
        'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
        'spaceCharacter' => '-',
        'languageGetVar' => 'L',
        'segTitleFieldList' => 'tx_realurl_pathsegment,alias,nav_title,title',
 
        // necessary for autoUpdatePathCache                                                                                                                          
        'disablePathCache' => 0,
        'autoUpdatePathCache' => 1,
        'expireDays' => 90,
    ),
    'fixedPostVars' => array(
    ),
    'postVarSets' => array(
        '_DEFAULT' => array (
            'album-page' => array(
                array(
                   'GETvar' => 'tx_lzgallery_pi1[pointer]',
                ),
            ),
            'album' => array (
                array (
                    'GETvar' => 'tx_lzgallery_pi1[showUid]',
                    'lookUpTable' => array (
                        'table' => 'tx_lzgallery_galleries',
                        'id_field' => 'uid',
                        'alias_field' => 'title',
                        'addWhereClause' => ' AND NOT deleted',
                        'useUniqueCache' => '1',
                        'useUniqueCache_conf' => array (
                            'strtolower' => '1',
                            'spaceCharacter' => '-',
                        ),
                    ),
                 ),
            ),
            'previous-album' => array(
                array(
                    'GETvar' => 'tx_lzgallery_pi1[old]',
                ),
            ),
            'view-mode' => array(
                array(
                   'GETvar' => 'tx_lzgallery_pi1[colrows]',
                ),
            ),
            'photo' => array(
                array(
                   'GETvar' => 'tx_lzgallery_pi1[pic]',
                ),
             ),
        ),
    ),
    'fileName' => array (
        'index' => array(
            'backend.php' => array(
                'keyValues' => array (
                    'type' => 100,
                )
            ),
            'print' => array(
                'keyValues' => array(
                    'type' => 98,
                )
            ),
            '_DEFAULT' => array(
                'keyValues' => array(
                )
            ),
        ),
    ),
 );
 
----
-- [[User:OldVrom]]  2007-07-28 
 
* realUrl with support of .shtml and one only level (this was needed for compatibility with old URL like http://www.domain.com/some_url.shtml). This config can have some unneded things, the most important is 
 
                 'userFunc' => 'EXT:realurl/class.tx_realurl_dummy.php:&tx_realurl_dummy->main',
and 
 
     		'defaultToHTMLsuffixOnPrev' => '.shtml',
 
 
 
       <?php
 
 
 
       $TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT'] = array(
             'init' => array(
                 'enableCHashCache' => 1,
                 'appendMissingSlash' => 'ifNotFile',
                 'enableUrlDecodeCache' => 0,
                 'enableUrlEncodeCache' => 1,
                 'respectSimulateStaticURLs' => 0,
                 'postVarSet_failureMode'=>'redirect_goodUpperDir',
             ),
         'redirects_regex' => array (
 
         ),
         'preVars' => array(
                     ),
          'pagePath' => array(
                 'type' => 'user',
                 'userFunc' => 'EXT:realurl/class.tx_realurl_dummy.php:&tx_realurl_dummy->main',
                 'spaceCharacter' => '-',
                 'languageGetVar' => 'L',
                 'expireDays' => 7,
                 'rootpage_id' => 1,
             ),
 
           'postVarSets' => array(
                 '_DEFAULT' => array(
       /**********************/
                     // news archive parameters
                     'archive' => array(
                         array(
                             'GETvar' => 'tx_ttnews[year]' ,
                             ),
                         array(
                             'GETvar' => 'tx_ttnews[month]' ,
                                 'valueMap' => array(
                                 'january' => '01',
                                 'february' => '02',
                                 'march' => '03',
                                 'april' => '04',
                                 'may' => '05',
                                 'june' => '06',
                                 'july' => '07',
                                 'august' => '08',
                                 'september' => '09',
                                 'october' => '10',
                                 'november' => '11',
                                 'december' => '12',
                                 )
                             ),
                         ),
 
 
                     // news pagebrowser
                     'all' => array(
                         array(
                             'GETvar' => 'tx_ttnews[all]',
                             ),
                         ),
 
                     'ntype' => array(
                         array(
                             'GETvar' => 'tx_ttnews[typeOfNews]',
                             ),
                         ),
                      // news pagebrowser
                     'browse' => array(
                         array(
                             'GETvar' => 'tx_ttnews[pointer]',
                             ),
                         ),
 
                     // news categories
                     'select_category' => array (
                         array(
                             'GETvar' => 'tx_ttnews[cat]',
                             ),
                         ),
                     // news articles and searchwords
 
                     'single' => array(
                         array(
                             'GETvar' => 'tx_ttnews[tt_news]',
                             'lookUpTable' => array(
                                 'table' => 'tt_news',
                                 'id_field' => 'uid',
                                 'alias_field' => 'uid',
                                 'addWhereClause' => ' AND NOT deleted',
                                 ),
                             ),
                         array(
                             'GETvar' => 'tx_ttnews[swords]',
                             ),
                         ),
 
                     ), 
        /*******************************/
                 ),
           'fileName' => array(
                 'defaultToHTMLsuffixOnPrev'=>1,
                 'index' => array(
                     'rss.xml' => array(
                         'keyValues' => array(
                             'type' => 100,
                         ),
                     ),
                     'rss091.xml' => array(
                         'keyValues' => array(
                             'type' => 101,
                         ),
                     ),
                     'rdf.xml' => array(
                         'keyValues' => array(
                             'type' => 102,
                         ),
                     ),
                     'atom.xml' => array(
                         'keyValues' => array(
                             'type' => 103,
                         ),
                     ),
                 ),
     		'_DEFAULT' => array(
     			'keyValues' => array(
     				)
     			),            
                 // add .shtml suffix to the end of the path generated
     		'defaultToHTMLsuffixOnPrev' => '.shtml',
             ),
       );
       ?>
Go to: typo3.org    
Login, and you can edit.
Personal tools
Namespaces

Variants
Actions