Note the upgraded forum! If you are experiencing issues logging in, you may need to reset your password which should send an email. If the email doesn't arrive, be sure to check your spam folder just in case.

Event detail page - failed to route

edited January 28 in Modules
I'm using event module generated via cli, and I got a 404 error whenever I go to the events/{slug}.
Is it something about the routing?
Because I have news module generated via cli too, and it has same config like the event module, the only different config is the preview_path for news is 'news/{year}/{month}/{day}/{slug}', while the preview_path for events is 'events/{slug}'

My_fuel_modules.php :
$config['modules']['events'] = array( 'preview_path' => 'events/{slug}', // put in the preview path on the site e.g products/{slug} 'model_location' => '', // put in the advanced module name here 'pages' => array( 'base_uri' => 'events', 'per_page' => 9, 'list' => 'events', 'post' => 'events/detail', ) );
I have tried to change the preview_path for events to 'events/{year}/{month}/{day}/{slug}', and it only works in the admin cms.

I also wonder why the news module preview_path has to be like so: 'news/{year}/{month}/{day}/{slug}'? Is it because it created by default since it is a sample generated module? Can I change it to 'news/{slug}'?

It would be great if anyone can help. Thanks.

Comments

  • edited 3:58PM
    The preview_path is specific to the CMS side of things. You can add a "preview_path" method to your model to handle more complicated URI routing for your preview path which get's passed an array of record values. With regards to setting up routing for your module's post pages, see the post pages documentation here:
    http://docs.getfuelcms.com/modules/simple#post_pages
Sign In or Register to comment.