RealURL
| < 1.3.2. Page resolve methods, how does it work? | Table Of Content | 1.3.4. Known problems (class: tx_realurl_advanced) > |
1.3.3. Configuration
You should create Domain-records on the pages where domains start. Even if you only have one domain, it's a good idea to create a Domain-record for it. There's one thing you should note:
If you have installed TYPO3 in the document-root of a host, you should create a domain-record named like 'www.server.com'. If, on the other hand, your TYPO3-installation is in a different directory, you should create a domain-record named something like 'www.server.com/the_path_to_your_typo'. Slashes at the end don't matter that much.
Configure "realurl" to work with "tx_realurl_advanced" ID encoding
Simply set this configuration for the key "pagePath" in the configuration array:
'pagePath' => array(
'type' => 'user',
'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
'spaceCharacter' => '-',
'languageGetVar' => 'L',
'expireDays' => 3
),
The directives specific for "tx_realurl_advanced" are these:
|
Directive: |
Data Type: |
Description: |
|---|---|---|
|
languageGetVar |
string |
Defines which GET variable in the URL that defines language id; if set the path will take this language value into account and try to generate the path in localized version. |
|
expireDays |
integer |
The time the old URL of a page whose pagetitle changed will still be remembered (in days) (Temporarily disabled) |
|
spaceCharacter |
|
Normally, this defaults to an underscore (_), which is used to replace spaces and such in an URL. You can set this to e.g. a hyphen (-) if you want to. |
|
segTitleFieldList |
list of fieldnames |
The prioritized order of field names from pages table (root line !) that is used when building the speaking URL. Default is "tx_realurl_pathsegment,alias,nav_title,title" (for Alternative Page Language records this is only "nav_title, title"). Notice: If you specify user defined fields which are not currently in root line you will have to add them to the root line via "$GLOBALS['TYPO3_CONF_VARS']['FE']['addRootLineFields']" |
|
disablePathCache |
boolean |
Will disable the usage of path cache. The system will rely solely on forward-lookups on the fields in "segTitleFieldList". |
|
firstHitPathCache |
boolean |
If set, then the path-cache look up is accepted only if it returns a result in the first hit. It will do so only when no postVarSets are used for the URL. |
|
rootpage_id |
integer |
Defines the root page uid of the site for which the configuration is made. This setting is needed if you run multiple sites in the same database using real urls for more than one of the sites. The setting makes it possible for the "path-to-id" algorithms to distiguish the sites. For instance two sites might have the same page title on the first level which will generate the same speaking url path. In such a case two different IDs are associated with the same page path and something is needed to distinguish the look ups. It is also necessary to set this if the "default" site is not the first page under the page tree root! In order to configure different sites you simply use the possibility to make different configuration for different domains. See the main section about configuration. It is important that you use the uid of the root page in the sites. Otherwise the fall-back look up of page paths will not work correctly. See example below |
|
encodeTitle_userProc |
user function |
Additional user processing in "encodeTitle()". |
|
dontResolveShortcuts |
boolean |
If set, page shortcuts are not resolved to their destination page. |
|
excludePageIds |
string |
Comma list of page ids to exclude from being realurl rendered. The list must NOT contain any spaces between page id numbers! |
Example: Configuration of realurl for use on more than one domain in the same database
1: $TYPO3_CONF_VARS['EXTCONF']['realurl'] = array(
2: '_DEFAULT' => array(
3: 'pagePath' => array(
4: 'type' => 'user',
5: 'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
6: 'rootpage_id' => 437
7: ),
8: ),
9: 'www.test1.intra' => array(
10: 'pagePath' => array(
11: 'type' => 'user',
12: 'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
13: 'rootpage_id' => 111
14: ),
15: )
16: );
Notice how the "rootpage_id" is set differently for these two cases!