ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Faceted Navigation with Playa

October 30, 2011 2:48am

Subscribe [2]
  • #1 / Oct 30, 2011 2:48am

    Ministry Design

    8 posts

    Hi All,

    I need some help setting up ‘faceted navigation’ using Playa and I’m hoping someone out their can offer some much needed advice!

    This is my very first EE project ...

    Here’s the scenario:
    I have 3 channels setup - instructors, lesson types offered and areas covered.  When you add an instructor via the CP you indicated via Playa fields the lesson types offered by that instructor and the areas he/she covers i.e. Edinburgh, Glasgow.

    On the front end each lesson type has its own page.  Each lesson type page displays the instructors operating in that area (see http://202316.temp-dns.com/driving-school/non-intensive and click on Instructors in the tabbed panel). As you can see the visitor sees a list of instructors.  What I want to be able to do is have an areas covered drop down within the instructors tab so that the visitor can filter the instructors by the areas covered.

    Any ideas or starters for this type of scenario?

    Thanks a million,
    Carl

  • #2 / Oct 30, 2011 8:42am

    Rob Allen

    3114 posts

    Hi Carl

    That’s a bit of a stinker to get your head around 😉

    I’d probably first look at using URL segments to get the area using a modified version of the drop down at
    http://ellislab.com/expressionengine/user-guide/modules/channel/categories.html#category-dropdown-menu

    Something like this to pull in a list of the Playa areas:

    <form name="catmenu" action="">
    <select name="selcat" [add the js]>
    <option value="">--Select Location--</option>
    {playa_area_field}
    <option value="{path='{segment_1}/{segment_2}'}/{area_name}">{area_name}</option>
    {/playa_area_field}
    </select>
    </form>

    So when selected that might give you a URL like /driving-school/non-intensive/glasgow

    From there you should be able to pull in Instructors related data by to segment_3/area “glasgow”

    Does that help?

  • #3 / Oct 30, 2011 9:17am

    Ministry Design

    8 posts

    Hi Rob,

    Thanks for the advice.  I’ll look into this.  I was really wanting to have the drop down for areas covered within the instructors tab.  When the visitor first views the instructors tab all instructors offering that lesson type would be listed.  However, the visitor would be able to filter using the areas covered drop down and the instructors would reload into the same instructors tab.  I guess it would be using AJAX to achieve this.

    Any further ideas on how to achieve this ...

    Thanks,
    Carl

  • #4 / Oct 30, 2011 9:57am

    Rob Allen

    3114 posts

    Hiya

    Yes you could still use the form inside the instructors tab.

    When you first land on the instructors page you’d list all instructors? By using the form and {segment_3} you can then list the same instructors but only those that match the value (area) in that segment.

    You could use Ajax but it wouldn’t work for anyone without Javascript, so I’d just use the segment approach.

  • #5 / Oct 30, 2011 10:45am

    Ministry Design

    8 posts

    Thanks Rob - I’ll take a look tomorrow and see if I can get it working - I may come back to you then if I get into difficulty, if that’s okay?

    Carl

  • #6 / Oct 30, 2011 12:38pm

    Rob Allen

    3114 posts

    Yes by all means give me a shout 😊

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases