:any under domain root

edited January 2012 in Share
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

  • edited 3:36PM
    Perhaps you could try something like this:
    if (!is_home()) { $pages[':any'] = array('view' => 'brand'); $pages[':any/:any'] = array('view' => 'model'); $pages['customer-service'] = array('view' => 'customer-service'); }
  • edited 3:36PM
    sweet, thanks. simple solution in the end. :D
Sign In or Register to comment.