Hey Guys,
I have tried to implement the solution in Romains link but still seem to be having issues. I have set the context values and created the plugin. Please see attached screendumps of my Context settings and here is my plugin code:
<?php<br />$pieces = explode(’/’, trim($_REQUEST[$modx->getOption(’request_param_alias’, null, ’q’)], ’/’), 2);<br />if (count($pieces) > 0) {<br /> switch ($pieces[0]) {<br /> case ’cy’:<br /> if (isset($pieces[1])) {<br /> $_REQUEST[$modx->getOption(’request_param_alias’, null, ’q’)] = $pieces[1];<br /> } else {<br /> $_REQUEST[$modx->getOption(’request_param_alias’, null, ’q’)] = ’’;<br /> }<br /> $modx->switchContext(’cy’);<br /> break;<br /> default:<br /> break;<br /> }<br />}
The plugin listens for onHandleRequest.
If I try to visit URL: http://localhost:85/grayswaste/web/ or http://localhost:85/grayswaste/cy/ I get a 404 error.
Have I missed something?
Cheers,
WF