Hi,
I was wondering what the preferred method would be for setting up a site for handling this structure:
some-ecommerce-website-that-sells-widgets.com/$brand_slug/
some-ecommerce-website-that-sells-widgets.com/$brand_slug/$model_slug/
** with other controllers and opt in controllers, such as /contact, /cart, /etc
Should I be making changes to the /views/_variables/global.php, /config/routing.php, both, or somewhere else?
I was thinking something like this in global.php:
$pages[':any'] = array('view' => 'brand');
$pages[':any/:any'] = array('view' => 'model');
$pages['customer-service'] = array('view' => 'customer-service');
** /contact works fine as is because it a controller, which takes precedence.
If the above is the preferred method, what would I use to make sure the route goes correctly to the home view,
tried :
$pages[''] = array('view'=> 'home');
but doesn't seem to work with the current configuration.
Thanks v much.
Comments
if (!is_home()) { $pages[':any'] = array('view' => 'brand'); $pages[':any/:any'] = array('view' => 'model'); $pages['customer-service'] = array('view' => 'customer-service'); }