Custom Page List - Filter by attribute (multiple pages / one-to-many-relation)

Permalink
Hey c5 folks!

I'm looking for an easy way to use a page list (self-coded - with api methods:http://www.concrete5.org/documentation/developers/pages/searching-a... to achieve the following:

We want to implement a small city night guide for a specific one-day-event, so we have multiple bus routes with multiple bus stops. Every route and every stop will have their own page.

Example:
- homepage
--routes
---route 1
---route2
--stops
---stop 1
---stop2
..

Now the problem:
One bus stop can be related to multiple routes.

Example:
bus stop 1 - route 1, route 7
bus stop 2 - route 1
bus stop 3 - route 3, route 7

Which attribute should I use to store this efficently for the page list searching? Has anybody else implemented something similiar before?

(Use case -> page for "route 7" should show all stops related to it)

Thanks in advance for inspiration & help!

Best regards,
Matthias

programmieraffe
 
Justin1978 replied on at Permalink Reply
Justin1978
I think you could simply accomplish this with Page Aliases. Make a page for every route but put your bus stops under a default page ('Bus Stops') for example. Then create an alias for each bus stop under the route pages. This is simular to adding a new page, only you add an alias. Aliases allow you to a single page under multiple pages.

So your page structure would be like this:
> Bus Stops
    > Stop 1
    > Stop 2
    > Etc
> Bus Routes
    > Scenic route
        > Alias of Stop 1
    > Fast Route
       > Alias of Stop 1
       > Alias of Stop 2