I'm new with modx and have worked most with drupal. My new employer works with modx and now im starting to explore and discover modx and i must say that it's pretty good and makes development fast.
Here's what i cant figure out. I want to simulate the $q. I have a plugin that runs on a request (babel multilingual) and now i am tuning that plugin to fit more of oure needs. So now i do not want to return a $q trough htaccess because that gives not te desired result since i have to do some more checks.
So the question now is how do i tell modx within a plugin that runs on a request that i want to get a document and return / show it. Because at this moment it just prints the home document since i have not told modx what document to return.
Here's the snippet:
if($modx->context->get('key') != "mgr"){
switch ($_REQUEST['cultureKey']) {
case 'de':
/* switch the context */
$modx->switchContext('de');
if(isset($_REQUEST['langProduct']) && $_REQUEST['langProduct'] != 'booten'){
$modx->sendErrorPage();
} else {
$getJacht = $_REQUEST['langProduct'];
We got a result and now we need to tell modx that we want to display a specific document by passing an document id and returning that...
}
break;
case 'en':
/* switch the context */
$modx->switchContext('en');
if(isset($_REQUEST['langProduct']) && $_REQUEST['langProduct'] != 'yachts'){
$modx->sendErrorPage();
}
break;
default:
/* Set the default context here */
$modx->switchContext('web');
if(isset($_REQUEST['langProduct']) && $_REQUEST['langProduct'] != 'jachten'){
$modx->sendErrorPage();
}
break;
}
unset($_GET['cultureKey']);
unset($_GET['langProduct']);
}
Here's the htaccess
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(nl|en|de)/(jachten|yachts|booten)/details/(.*)/(.*).html$ index.php?langProduct=$2&cultureKey=$1&lang=$1&getJacht=$3 [L,QSA]
Now why i want to return a document is because in that document i am calling a snippet which includes another script which we use that prints values trough a SOAP call so i don't have the values in the modx database and i can not return modx documents physically and that is why i am using this construction.
Of course if there's a better option or suggestion i am open to hear it since i'm starting with modx.
[ed. note: michalski last edited this post 14 years, 1 month ago.]