Skip to content

Notes for Integrators

Dmitry Dulepov edited this page Mar 3, 2016 · 24 revisions

Tips

FAQ


Tips

Configuring languages

There are two ways people use languages with RealURL. Assuming that main language is German and secondary is French, here are two possible scenarios.

First scenario is when default language is omitted from URL. Example URLs will look like:

  • German: /ernaehrung/rezepte/rezeptsuche/
  • French: /fr/alimentation/recettes/recherche-de-recettes/

Second case id when default segment also present:

  • German: /de/ernaehrung/rezepte/rezeptsuche/
  • French: /fr/alimentation/recettes/recherche-de-recettes/

Selection is up to the integrator and its customer. RealURL allows both.

For the first case you configure RealURL as follows.

RealURL configuration

'preVars' => array(
  0 => array(
    'GETvar' => 'L',
    'valueMap' => array(
      'fr' => 1,
    ),
    'noMatch' => 'bypass',
  ),
),

TypoScript

config {
  sys_language_uid = 0
  language = de
}

[globalVar = GP:L = 1]
config {
  sys_language_uid = 1
  language = fr
}
[global]

For the second case configuration is different:

RealURL configuration

'preVars' => array(
  0 => array(
    'GETvar' => 'L',
      'valueMap' => array(
        'de' => 0,
        'fr' => 1,
    ),
  ),
),

TypoScript

config {
  sys_language_uid = 0
  language = de
  defaultGetVars {
    L = 0
  }
}

[globalVar = GP:L = 1]
config {
  sys_language_uid = 1
  language = fr
}
[global]


FAQ

How do I set 'L' to the default language value without using it in the URL?

You should use both RealURL and TypoScript for that. RealURL configuration will look like:

array(
	'GETvar' => 'L',
	'valueMap' => array(
		'fr' => 1,
		'it' => 2,
	),
	'noMatch' => 'bypass',
),

TypoScript will look like:

config {
	language = de
	sys_language_uid = 0
}

[globalVar = GP:L = 1]
config {
	language = fr
	sys_language_uid = 1
}
[globalVar = GP:L = 2]
config {
	language = it
	sys_language_uid = 2
}
[global]

My record titles are not unique. How do I use them in aliases?

RealURL appends numbers in such cases. However if you clear caches, URLs may change because numbers are appended on "first come – first served" basis. If you want to ensure unique URLs, use uid as a part of the alias:

array(
	'GETvar' => 'tx_myext_plugin[uid]',
	'lookUpMap' => array(
		...
		'alias_field' => 'CONCAT(title, '-', uid),
		...
	)
)

My URLs still look like /index.php?id=12345. What's the problem?

You forgot to enable RealURl in TypoScript using

config.tx_realurl_enable = 1

My URLs look like /46/. What's the problem?

This does not happen with RealURL 2.x anymore. Upgrade from version 1.x to 2.x.

RealURL does not work!

It does. Please, check you configuration and ask questions in TYPO3 mailing lists.

I found a bug...

I can add very little to this classic writing...

The first thing you do is you ask in the TYPO3 mailing lists. If nobody else has this problem, than you have to double check that you do everything correctly (configuration, root page flags, database up to date, etc). Only than you write it in the bug tracker and put as many details as you can.