Multidomain realurl configuration in postVarSet - typo3

I have a TYPO3 using 8.7.22 version. It's a muldomain website, and here's what the domains look like :
website.com/domain1
website.com/domain2
website.com/domain3
website.com/domain4
Each Domain has a separated tree in TYPO3, with different domain record each.
Now, I'm trying to make realurl work with all my domains, but i got this error every time I visit:
Page Not Found Reason:
Segment "domain1" was not a keyword for a postVarSet as expected on page with id=1.
To be honest, I have absolutely no idea how to define the domains in the postVarSet section. Here's my current realurl configuration:
<?php
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DEFAULT'] = array(
'init' => array(
'appendMissingSlash' => 'ifNotFile,redirect',
'emptyUrlReturnValue' => '/',
),
'pagePath' => array(
'rootpage_id' => '1',
),
'fileName' => array(
'defaultToHTMLsuffixOnPrev' => 0,
'acceptHTMLsuffix' => 1,
'index' => array(
'print' => array(
'keyValues' => array(
'type' => 98,
),
),
),
),
);
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['website.com/domain1'] = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DEFAULT'];
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['website.com/domain2'] = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DEFAULT'];
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['website.com/domain2']['pagePath']['rootpage_id'] = '274';
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['website.com/domain3'] = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DEFAULT'];
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['website.com/domain3']['pagePath']['rootpage_id'] = '256';
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['website.com/domain4'] = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DEFAULT'];
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['website.com/domain4']['pagePath']['rootpage_id'] = '349';
Any idea?
Thanks a lot

Here's how i resolved the issue :
Page:id=0
|
|--Main root page (domain record = website.com)
|---- Root 1 (domain record = website.com/domain1)
|---- Root 2 (domain record = website.com/domain2)
|---- Root 3 (domain record = website.com/domain4)
|---- Root 4 (domain record = website.com/domain3)
In all root pages, including the main root page, i checked the "Use as Root Page" option, and created a template for a new website.
And finally, put this typoscript code in all roots:
config.typolinkEnableLinksAcrossDomains = 1
config.absRefPrefix = /
config.tx_realurl_enable = 1

Related

589/5000 How do I configure in realurl a speaking URL for the tx_news date filter?

How do I configure in the extension realurl a destination page for the date menu from tx_news.
Currently my realurl looks as follows:
http://pastebin.com/SyEzttqD
The links are output in the form:
MyDomain.tdl / nwes.html? Tx_news_pi1% 5BoverwriteDemand% 5D% 5Byear% 5D = 2017 & tx_news_pi1% 5BoverwriteDemand% 5D% 5Bmonth% 5D = 03 & cHash = b671ba816868bf63e419eeacacc74175
The goal would be:
Mydomain.tdl / date-filter / year / month.html
The rest of the tx_news configuration seems to be running.
Thank you for your help.
Add this to your realurl_conf.php and delete the URL Data in TYPO3 afterwards:
'postVarSets' => array(
'_DEFAULT' => array(
'controller' => array(
'date-filter' => array(
array(
'GETvar' => 'tx_news_pi1[overwriteDemand][year]',
),
array(
'GETvar' => 'tx_news_pi1[overwriteDemand][month]',
),
),
)
)
)

Create a subpanel to a flex related module in sugarcrm

I followed that tutorial ( http://developer.sugarcrm.com/2011/05/16/howto-create-a-flex-relate-for-other-modules/ ) to create a flex related module between the Leads and the Accounts module and PRO_Profil module.
One account can have multiple PRO_Profil items. Same for the lead module, it can have multiple PRO_Profil items. In the table pro_profil, there is a creation of parent_id and parent_name
Then I follow that tutorial ( http://developer.sugarcrm.com/2011/05/18/howto-add-a-subpanel-using-code/ ) to create a subpanel.
But the subpanel are not shown on the account detail view and neither in the lead detail view.
This result with the creation of 2 files
custom\Extension\modules\Leads\Ext\Layoutdefs_profil.php
<?php
$layout_defs["Leads"]["subpanel_setup"]['PRO_Profil'] = array (
'order' => 130,
'module' => 'PRO_Profil',
'get_subpanel_data'=>'PRO_Profil',
'sort_order' => 'asc',
'sort_by' => 'name',
'subpanel_name' => 'default',
'title_key' => 'LBL_TEST_FLEXPARENT',
);
?>
custom\Extension\modules\Leads\Ext\Vardefs\infos.php
<?php
$dictionary['Lead']['fields']['PRO_Profil'] = array(
'name' => 'PRO_Profil',
'type' => 'link',
'relationship' => 'profils_leads',
'module' => 'PRO_Profil',
'bean_name' => 'PRO_Profil',
'source' => 'non-db',
'vname' => 'LBL_TEST_FLEXPARENT',
);
?>
I have the feeling that sugarcrm 6.3 or 6.4 changed the system
where is the problem ?
regards
I tryied also :
http://forums.sugarcrm.com/f148/howto-prospect-list-subpanel-leads-sugarcem-6-4-maybe-6-3-a-78030/

Zend_Controller_Router_Route_Regex rewrite all my module links

I'm using Zend_Framework 1. In my Bootstrap.php I rewrite my categories link something like that:
$route = new Zend_Controller_Router_Route_Regex("^([a-z,0-9,-]*)(/|)([a-z,0-9,-]*)(/|)([a-z,0-9,-]*)(/|)([a-z,0-9,-]*)(/|)([a-z,0-9,-]*)(/date/|)([a-z]*)(/page/|)([0-9]*)$",
array(
"module" => "default",
"controller" => "categories",
"action" => "index"
),
array(
1 => 'firstparam',
3 => 'secondparam',
5 => 'theeparam',
7 => 'fourparam',
9 => 'fiveparam',
11 => 'date',
13 => 'page',
)
);
$router->addRoute("RouteCategories", $route);
The problem is that all my admin links (a module I use) are now enter this condition. Is there any way to apply this condition only to module: default without rewrite all my admin links? Thanks

Route sudmains controller with Zend

I have the following structure on my app:
Modules =>
default => site.com
blog => blog.site.com
admin => admin.site.com
I used this code on my bootstrap to allow subdomains and redirect to the follow module:
$pathRoute = new Zend_Controller_Router_Route(':controller/:action/*', array('controller' => 'index', 'action' => 'index'));
$frontController = Zend_Controller_Front::getInstance();
$router = $frontController->getRouter();
$blogDomainRoute = new Zend_Controller_Router_Route_Hostname(
'blog.site.com', array(
'module' => 'blog',
'controller' => 'index',
'action' => 'index'
));
$router->addRoute('blogdomain', $blogDomainRoute->chain($pathRoute));
And the same code to adminDomainRoute.
It works fine! But now i notice that my pagination route don't work, i have the follow route to manage pages in admin module:
routes.usuarios.route = /usuarios/pagina/:pagina
routes.usuarios.defaults.module = admin
routes.usuarios.defaults.controller = usuarios
routes.usuarios.defaults.action = index
routes.usuarios.defaults.pagina = 1
I tried to change the route to
routes.usuarios.route = admin.site.com/usuarios/pagina/:pagina
But i still got action no found:
array (
'controller' => 'usuarios',
'action' => 'pagina',
'module' => 'admin',
)
How can i route admin.site.com/usuarios/pagina/1 admin.site.com/usuarios/pagina/3 ?
The thing that jumps at me from your setup is, that in the ini format (your current admin route), you are using the default router. Well this router knows nothing about the hostname you are on, so it is looking for an url like this one:
site.com/admin.site.com/usuarios/pagina/1 admin.site.com/usuarios/pagina/3
What you want is something like this:
//Create a hostname route. This route is only concerned with the subdomain part of the uri
$hostnameRoute = new Zend_Controller_Router_Route_Hostname(
'admin.:host.:domain');
//Create a default router that would take care of the rest of the routing.
$defaultRoute = new Zend_Controller_Router_Route(
'/usuarios/pagina/:pagina',
array(
'module'=>'admin',
'controller'=>'usuarios',
'action'=>'index'
)
);
//Chain those two routes together to make them go one after the other.
$defaultRoute=$hostnameRoute->chain($defaultRoute);
This code may need a bit of tweaking, but I think this should do what you need.

TYPO3 language switcher does not use the correct RealURL paths

I use the following TypoScript to generate a language switcher. It's basically a copy from an existing site where everything works fine:
lib.langMenu = HMENU
lib.langMenu {
special = language
addQueryString = 1
special.value = 0,1
special.normalWhenNoLanguage = 0
1 = TMENU
1 {
noBlur = 1
NO = 1
NO {
allWrap = <li>|</li>
stdWrap2.noTrimWrap = | | |
stdWrap.override = Deutsch || English
ATagParams = class="lang-switcher-de" || class="lang-switcher-en"
}
ACT < .NO
ACT = 1
ACT.allWrap = <li class="active">|</li>
wrap = <ul class="pull-right language"><li class="hidden-xs">Language:</li>|</ul>
}
}
Now, I use the following RealURL setup:
$TYPO3_CONF_VARS['EXTCONF']['realurl'] = array(
'_DEFAULT' => array(
'init' => array(
'enableCHashCache' => 1,
'enableUrlDecodeCache' => 1,
'enableUrlEncodeCache' => 1,
),
'preVars' => array (
0 => array (
'GETvar' => 'L',
'valueMap' => array (
'en' => '1',
),
'noMatch' => 'bypass',
),
),
'pagePath' => array(
'type' => 'user',
'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
),
)
);
The issue is that, say I have the following pages, with their German and English path:
produkte / products
produktuebersicht / product_overview
When I'm on /produkte/produktuebersicht, the language switcher generates a link to/en/produkte/produktuebersicht instead of /en/products/product_overview. This problem occurs on every single page.
It always takes the path of the wrong (read, current) language. I've checked the ID to path mapping and it looks fine to me:
The encode cache has these entries – but even when I delete them the problem persists:
The weird thing is that the menu itself is generated correctly. So how can I make it link to the right RealURLs in the language switcher?
Your RealURL pagePath section should include a languageGetVar setting.
From the RealURL documentation:
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.
Your pagePath section should look like:
'pagePath' => array(
'type' => 'user',
'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
'languageGetVar' => 'L'
),