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 1

RealURL with

  • tt_news
PHP script:
<?php
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DEFAULT'] = array(
	'init' => array(
		),
	'preVars' => array(
		/*
		array(
			'GETvar' => 'L',
			'valueMap' => array(
				'de' => '0',
				'en' => '1',
				'valueDefault' => 'de',
				),
			),
		*/
		),
	'pagePath' => array(
		'spaceCharacter' => '-',
		'expireDays' => 3
		),
	'fileName' => array (
		'defaultToHTMLsuffixOnPrev' => 1,
		'index' => array(
			'page.html' => array(
				'keyValues' => array (
					'type' => 1,
		        		),
				),
			),
		'print.html' => array(
			'keyValues' => array (
				'type' => 98,
				),
			),
		),
	'fixedPostVarSets' => array(
		),
	'postVarSets' => array(
		'_DEFAULT' => 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(
						'non-archived' => -1,
						),
					),
	  			),
	  
			'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,
							'spaceCharacter'	=>	'-',
							),
						),
					),
				),
	 		'article' => array( 
				array (
					'GETvar' => 'tx_ttnews[backPid]',
					// 'valueMap => array(
					// ),
					),
				array (
					'GETvar' => 'tx_ttnews[tt_news]',
					'lookUpTable' => array (
						'table'		=>	'tt_news',
						'id_field'	=>	'uid',
						'alias_field'	=>	'title',
						'maxLength'	=>	12,
						'addWhereClause'=>	'AND NOT deleted',
						'useUniqueCache'=>	1,
						'useUniqueCache_conf'	=>	array (
							'strtolower'		=>	1,
							'spaceCharacter'	=>	'-',
							),
						),
					),
				),
			),
		),  
	);

Example 2

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
PHP script:
 <?php
 // RealURL config
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'] = array(
 	// spanish subsite with basque & catalan
 	'espana.tokitsu.com' => array(
 		'init' => array(
 			// 'appendMissingSlash' => 'ifNotFile',
 		),
 		'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 readable page/sub-page/sub-sub-page.html
 		'pagePath' => array(
 			'spaceCharacter' => '-',
 			'expireDays' => 3,
 			'rootpage_id' => 67,
 		),
 		'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(
 			// 'appendMissingSlash' => 'ifNotFile',
 		),
 		'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 readable page/sub-page/sub-sub-page.html
 		'pagePath' => array(
 			'spaceCharacter' => '-',
 			'expireDays' => 3,
 			'rootpage_id' => 13,
 		),
 		'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(
 			// 'appendMissingSlash' => 'ifNotFile',
 			),
 		'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,
 		),
 		),
 
 );


Example 3

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:
<?php
 $GLOBALS['TYPO3_CONF_VARS']['FE']['pageNotFound_handling'] = 'READFILE:fileadmin/templates/pagenotfound.html';
 
 $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DEFAULT'] = array(
    'init' => array(
        'appendMissingSlash' => 'ifNotFile',
    ),
    '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(
        'spaceCharacter' => '-',
        '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(
                )
            ),
        ),
    ),
 );

Example 4

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 unneeded things, the most important is

 'defaultToHTMLsuffixOnPrev' => '.shtml',
PHP script:
       <?php

       $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DEFAULT'] = array(
             'init' => array(
                 'appendMissingSlash' => 'ifNotFile',
                 'postVarSet_failureMode' => 'redirect_goodUpperDir',
             ),
         'preVars' => array(
                     ),
          'pagePath' => array(
                 'spaceCharacter' => '-',
                 '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(
                 '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',
             ),
       );