Good evening folks,
I recently enquired what the best way to build a UGC site using ExpressionEngine would be. I decided to go down the route of a custom module and that side of things is now working: a table is being created, users are able to add jobs from a form on the front end and there are tags available for me to use in my templates to 'list' and 'single' jobs.
However, I still can't get my head around the EE URL structure.
The site has a number of top-level sections which each of the listing types fall under. The example I gave in the previous post was 'jobs' but this actually falls under the 'opportunities' section. Therefore, the URL structure I'm trying to achieve is:
/opportunities/jobs/ jobs listing page /opportunities/jobs/*id*-*job-title*/ job single page /opportunities/jobs/add/ add job page /opportunities/jobs/edit/*id*-*job-title*/ edit job page /opportunities/jobs/delete/*id*-*job-title*/ delete job page /opportunities/jobs/success/ success page for add/edit/delete job /opportunities/jobs/filter/today/ jobs posted today /opportunities/jobs/filter/this-week/ jobs posted in last 7 days /opportunities/jobs/filter/2013/oct/ jobs posted in october 2013 ... (previous 12 months) /opportunities/jobs/filter/2012/nov/ jobs posted in november 2012 /opportunities/jobs/filter/archive/ (including those with a status of 'closed')
I'm baffled as to whether this URL mapping is something that I would build into my module (in which case, could someone please point me in the direction of documentation as I can't find anything about it anywhere...) or whether I'd just create an 'opportunities' template group and the use the 'index' template as a controller to embed the correct sub-template (based on {if} statements checking the value of the third segment).
Or, is this a job for Router, or even some good old .htaccess rules?
Many thanks, as always, for any advice.
Edit: I've found the pages module, which allows me to add a page with the URL /opportunities/jobs but then /opportunities/jobs/add returns a 404. I doubt this is the correct route as it re-introduces the problems I originally faced when using Structure...