I have an URL which looks like this:
http://domain.com/leistungen/industrial-design/?tx_fsproject_fsprojectfp%5Bproject%5D=2&tx_fsproject_fsprojectfp%5Baction%5D=show&tx_fsproject_fsprojectfp%5Bcontroller%5D=Project&cHash=7c405bcde49853af9a7e78bdf465002c
Using RealURL with the following configuration (and some hook functions as explained here):
'postVarSets' => array(
'_DEFAULT' => array(
// projects
'industrial-design' => array(
array(
'GETvar' => 'tx_fsproject_fsprojectfp[controller]',
),
array(
'GETvar' => 'tx_fsproject_fsprojectfp[action]',
),
array(
'GETvar' => 'tx_fsproject_fsprojectfp[project]',
'lookUpTable' => array(
'table' => 'tx_fsproject_domain_model_project',
'id_field' => 'uid',
'alias_field' => 'title',
'addWhereClause' => ' AND deleted !=1 AND hidden !=1',
'useUniqueCache' => 1,
'useUniqueCache_conf' => array(
'strtolower' => 1,
'spaceCharacter' => '-',
)
)
),
),
),
),
I get an URL looking like this:
http://domain.com/leistungen/industrial-design/industrial-design/projekt/project-b/
This is not bad. However, why does the industrial-design/ part show up twice?
The first industrial-design is the page that is being displayed. The second one is the keyword inserted by RealURL to identify the set of variables. To avoid that you can:
Change the structure of pages so that you don't have industrial-design page at all.
Rename the postVarSets that you set up in the RealURL configuration.
Use fixedPostVars instead as that doesn't use a keyword to identify the set of variables but a page UID.
Related
I have an extension for items, each has several fields. One field is name and one field is country.
In realurl_conf.php i can create a url like:
detail/name-1
with:
name' => array(
array(
'GETvar' => 'tx_myext_myplugin[model]',
'lookUpTable' => array(
'table' => 'tx_myext_domain_model_model',
'id_field' => 'uid',
'alias_field' => 'name',
'addWhereClause' => ' AND NOT deleted',
'useUniqueCache' => 1,
'useUniqueCache_conf' => array(
'strtolower' => 1,
'spaceCharacter' => '-',
),
),
),
But what if i also want to have the country in the url, like:
detail/country-xy/name-1
How can i achieve this?
Realurl can only map arguments which are available. Therefore you must also provide the country to the typolink generation.
I have a running TYPO3 installation (7.6) with with the latest realurl and news extension. All working fine. I now created a simple extension tx_ffscarexample and struggling to manipulate the paths for it. In tx_ffscarexample I have 'list, show, new, create, edit, update, delete' actions. Now, when first calling the page /car-example/ with the List View ... my path looks like:
List View
/car-example/
... I get all records showing in a table.
But already when I hover over the links I get like
/car-example/?tx_ffscarexample_carlist[car]=3&tx_ffscarexample_carlist[action]=show&tx_ffscarexample_carlist[controller]=Car&cHash=0b3f5b986dsdf95f33465e3d324e1e83a
When I then go into a detail view ... I get e.g.
Show View
/car-example/?tx_ffscarexample_carlist[car]=3&tx_ffscarexample_carlist[action]=show&tx_ffscarexample_carlist[controller]=Car&cHash=0b3f5b236dd5295f5f6234d324e1e83a
New View
/car-example/?tx_ffscarexample_carlist[action]=new&tx_ffscarexample_carlist[controller]=Car&cHash=4df2347378f318530423761f7627394a6
Edit View
/car-example/?tx_ffscarexample_carlist%5Bcar%5D=15&tx_ffscarexample_carlist%5Baction%5D=edit&tx_ffscarexample_carlist%5Bcontroller%5D=Car&cHash=72344542eaf1c64c12347dd3c7714
List View
/car-example/?tx_ffscarexample_carlist[action]=list&tx_ffscarexample_carlist[controller]=Car&cHash=23d56247c27805c2c234c8c23353c7e
In realurl_conf.php I've added for the extension:
...
'postVarSets' => array(
'_DEFAULT' => array(
'car' => array(
array(
'GETvar' => 'tx_ffscarexample_carlist[action]',
'valueMap' => array(
'list' => 'list',
'show' => 'show',
'new' => 'new',
'edit' => 'edit',
'create' => 'create',
'delete' => 'delete',
'update' => 'udpate'
),
'noMatch' => 'bypass'
),
array(
'GETvar' => 'tx_ffscarexample_carlist[controller]',
'valueMap' => array(
'car' => 'car',
),
'noMatch' => 'bypass'
),
array(
'GETvar' => 'tx_ffscarexample_carlist[car]',
'lookUpTable' => array(
'table' => 'tx_ffscarexample_domain_model_car',
'id_field' => 'uid',
'alias_field' => 'name',
'addWhereClause' => ' AND NOT deleted',
'useUniqueCache' => 1,
'useUniqueCache_conf' => array(
'strtolower' => 1,
'spaceCharacter' => '-'
),
'languageGetVar' => 'L',
'languageExceptionUids' => '',
'languageField' => 'sys_language_uid',
'transOrigPointerField' => 'l10n_parent',
'autoUpdate' => 1,
'expireDays' => 180,
)
)
),
),
)
...
What am I missing?
What I would like to have is sth like ...
/car-example/car/
/car-example/car/new
/car-example/car/audi/
/car-example/car/audi/edit/
/car-example/car/audi/delete/
/car-example/car/bmw/
/car-example/car/bmw/edit/
/car-example/car/bmw/delete/
Seems like here are similar issues:
typo3 7, bootstrap_package, RealUrl and own extension
Fixed it. What I did was:
I deactivated and removed the extension.
Deleted typo3temp and all realurl tables.
Cleared caches in InstallTool
Installed the extension again.
-> Now everything works as expected
*Please make copies of records and tables before removing them just in case.
It might be due to the installation order:
"The order you will install the extensions matters! Make sure the RealURL extension is installed first, then the bootstrap package and afterwards the rest of the extensions which contain RealURL rules including your new one." (Source: https://aimeos.org/tips/tag/realurl/ )
When I got multiple values in my URL of the same name
e.g …&tx_myext_pi1[crit][]=1&tx_myext_pi1[crit][]=2…
and I want to have it multiple times in my RealUrl-ified URL
like …/crit/title-of-crit-1/crit/title-of-crit-2…
it's not working.
I only get …/crit/title-of-crit-1… and …/crit/title-of-crit-2… is missing
…&tx_myext_pi1[crit][]=1…
translates to …/crit/title-of-crit-1/… and
…&tx_myext_pi1[crit][]=2…
translates to …/crit/title-of-crit-2/…
so that part is working. But not multiple values.
Is this impossible to do with RealUrl?
Should I make a userFunc? How?
My RealUrl Conf
// …
'postVarSets' => array(
'_DEFAULT' => array(
'crit' => array(
array(
'GETvar' => 'tx_myext_pi1[crit][]',
'lookUpTable' => array(
'table' => 'tx_myext_domain_model_crit',
'id_field' => 'uid',
'alias_field' => 'title',
'languageGetVar' => 'L',
'languageExceptionUids' => '',
'languageField' => 'sys_language_uid',
'transOrigPointerField' => 'l10n_parent',
'autoUpdate' => 1,
),
),
),
),
// …
Is this impossible to do with RealUrl?
Yes, is impossible to achieve this using RealUrl.
The problem is that you are using array in the query string.
You can merge your values in one string
Like this:
/crit/title-of-crit-1,title-of-crit-1
Or
/crit/title-of-crit-1+title-of-crit-1
And split it when you need. by , Or + or another special character.
For example Drupal uses this rule for multiple values in views moudle.
I am running realURL 1.12.6 on TYPO3 4.5.26
I am used to realURL creating paths that contain the preVar also for the default language, like www.example.com/de/seite/ and www.example.com/en/page/
In one case, this is just not happening - or I think, only sometimes.
In most of the cases, I get www.example.com/seite/ and www.example.com/en/page/
Where can this be changed?
PS: Here's the beginning of my realurlconf:
$TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT'] = array(
'init' => array(
'enableCHashCache' => 1,
'appendMissingSlash' => 'ifNotFile',
'enableUrlDecodeCache' => 1,
'enableUrlEncodeCache' => 1,
'respectSimulateStaticURLs' => 0,
//'postVarSet_failureMode'=>'redirect_goodUpperDir',
),
'redirects_regex' => array (
),
'preVars' => array(
array(
'GETvar' => 'L',
'valueMap' => array(
'de' => '0',
'en' => '1',
),
'valueDefault' => 'de',
'noMatch' => 'bypass',
),
array(
'GETvar' => 'no_cache',
'valueMap' => array(
'no_cache' => 1,
),
'noMatch' => 'bypass',
),
),
If I use this configuration (valueDefault is set, noMatch not) then 404 error page is not triggered when calling urls like
www.domain.com/notexisting/someexistingpage/
or
www.domain.com/notexisting/
The 404 page is only triggered when calling urls like
www.domain.com/notexisting/alsonotexistingpage/
That means, realurl expects the first part of the url to be the language part (here: "notexisting") and if realurl can't map this key, it uses the "valueDefault". But I want the 404 to be triggered, how can I achieve this?
Edit: I've the solution now:
realurl config:
'GETvar' => 'L',
'valueMap' => array(
'en' => '0',
'de' => '1',
),
'noMatch' => 'bypass',
TypoScript config:
config.defaultGetVars.L = 0
config.linkVars = L
Remove 'noMatch' => 'bypass', from your preVar configuration. The GET-Parameter "L" is not set to "0" if you open "www.example.com", so then the noMatch just bypasses the preVar configuration. If you only set valueDefault, it should work fine.
I'm working on a website that is made in typo3. I'm doing a part of the website that is made by somebody else, so I don't know that much of typo3.
This website uses realurl to translate the url to a readable one. How can I make a realurl? When I make like for example the index page there is no realurl made for this page. How could I generate one?
First of all, check the manual of realurl :
http://typo3.org/extensions/repository/view/realurl/current/
http://typo3.org/documentation/document-library/extension-manuals/realurl/1.10.2/view/
Check if RealUrl is enabled via TypoScript.
Check if links are generated with TYPO3 API / TypoScript.
Use RealUrl configurators
http://typo3.org/extensions/repository/view/cbrealurl/current/
Dmitry got more relevant tutorials about RealURL:
http://www.dmitry-dulepov.com/2008/05/realurl-made-easy-part-1.html
http://www.dmitry-dulepov.com/2008/06/realurl-made-easy-part-2.html
RealURL will be very easy to understand when you'll make it work with default configuration and understand the meaning of parts: 'init', 'preVars', 'postVarSets', 'pagePath', 'fixedPostVars' and 'fileName'.
Copy my configuration
typoscript in setup:
config.simulateStaticDocuments = 0
config.baseURL = /
config.tx_realurl_enable = 1
config.uniqueLinkVars = 1
config.absRefPrefix = http://www.ceisufro.cl/
page.config.language = cl
config.sys_language_uid= 0
config.useSysLanguageTitle = 1
config.language= es
config.language_alt= es
config.htmlTag_langKey= es
config.linkVars = L
config.sys_language_overlay = 1
config.htmlTag_setParams = xmlns="http://www.w3.org/1999/xhtml"
xml:lang="es" lang="es"*
In file localconf.php
$TYPO3_CONF_VARS['EXTCONF']['realurl'] = array(
'www.ceisufro.cl'=> array(
'init' => array (
'enableCHashCache' => '1',
'appendMissingSlash' => 'ifNotFile',
'enableUrlDecodeCache' => '1',
'enableUrlEncodeCache' => '1',
),
'redirects' => array (
),
'preVars' => array(
'0' => array(
'GETvar' => 'L',
'valueMap' => array(
'es' => '1',
'en' => '0',
'it' => '4',
),
'noMatch' => 'bypass',
'valueDefault' => 'es',
),
),
'fileName' => array(
'defaultToHTMLsuffixOnPrev' => '1',
),
'pagePath' => array(
'type' => 'user',
'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
'spaceCharacter' => '-',
'languageGetVar' => 'L',
'expireDays' => '3',
'rootpage_id' => '1',
), 'fileName' => array (
'index' => array (
'rss.xml' => array (
'keyValues' => array (
'type' => '100',
'id' => '37'
),
),
'contacto.xml' => array (
'keyValues' => array (
'id' => '666',
'no_cache'=>'1'
),
),
)),
'fixedPostVars' => array(
),
),
);
go to ext manager, find the ext realurl and add the following configurations
check Enable automatic configuration
select Serializable in Automatic configuration file format
check Enable devLog
I wait to can help somebody