Closed siebird closed 10 years ago
You shouldn't have to do anything else:
':any' => function($router, $wildcard) {
$landing = array('status' => 'Open', 'channel_id' => 14),
$confirm = array('status' => 'Open', 'channel_id' => 16);
// is the current page a landing page?
if ($wildcard->isValidUrlTitle($landing)) {
$router->setTemplate('site/landing_page');
// is the current page a confirmation page
} else if ($wildcard->isValidUrlTitle($confirm)) {
$router->setTemplate('site/confirmation_page');
}
// dont do anything else, let native EE routing take place
},
Hmm, this seems to break everything now. Do you see any formatting issues?
$config['resource_router'] = array(
':any' => function($router, $wildcard) {
$landing = array('status' => 'Open', 'channel_id' => 14),
$confirm = array('status' => 'Open', 'channel_id' => 16);
// is the current page a landing page?
if ($wildcard->isValidUrlTitle($landing)) {
$router->setTemplate('site/landing_page');
// is the current page a confirmation page
} else if ($wildcard->isValidUrlTitle($confirm)) {
$router->setTemplate('site/confirmation_page');
}
},
);
Can you install the develop branch and see if that resolves it for you? There are some changes related to the :any wildcard in there.
Still throwing the 'white screen' on both front-end & CP
Typo in the example,
$landing = array('status' => 'Open', 'channel_id' => 14),
Should end with semicolon, not comma
$landing = array('status' => 'Open', 'channel_id' => 14);
Dagnabbit! All squared now.
Hey Rob,
I'm having trouble wrapping my head around the rules needed for landing pages (outside of structure) without conflicting with structure pages from
segment_1
. I have two channels for the landing pages:landing_page
&confirmation_page
(for goal tracking). How would I default back to Structure after the conditionals?