0

I'm trying to build a database of K-12 schools for a directory site and wanted to organize them nicely as well as make it easy to enter information in without re-entering the same info in too much.

I came up with this solution that involves 4 channels and playa fields:

  • Channel: States - has only Title field (50 entries)
  • Channel: Counties - has a Title field and a Playa field: state (58 entries in this channel for the state of CA alone)
  • Channel: School Districts - has a Title field and a Playa field: county (100's of entries in this channel for the state of CA alone)
  • Channel: Schools - has a Title field, a Playa field: district, as well as a number of other fields that pertain to the school.

I figured by having the prior relationships I can traverse up and get all the info I need without having to enter in the same info in each school all the time.

Main question is: Is my structure overkill?

My end goal is to use the module Reefine to use for filtering. This way users can use the filter menu to select their state, county and school district to find their school.

I have already entered some of the data in (all the states and counties for the state of CA, as well as about 150 school districts so far.

Any help/guidance for making this easier/more streamlined would be great. Thanks!

1 Answer 1

1

From a 50K foot view this approach seems feasible. Obviously when you have that many different nested relationships, you'll need to be conscious of performance and the number of queries on any given page, but that's something you can somewhat manage with your nesting/embedding technique and caching.

I'm working on a site with a similar problem where we have 50 items grouped into several sections, which are organized into an individual menu. Each of these (products, sections, menus) are channels, all connected via Playa.

My outer loop, which pulls in a menu and loops over individual sections looks like:

{exp:channel:entries
  channel="template_menu"
  disable="categories|category_fields|member_data|pagination|trackbacks"
  dynamic="on"
}

{tmpl_menu_sections}       
 {stash:embed:menu:menu_section stash:section_entry_id="{entry_id}"}
{/tmpl_menu_sections}

{/exp:channel:entries}

And then the embed which pulls in individual sections and loops over their menu items is:

{exp:channel:entries
  disable="categories|category_fields|member_data|pagination|trackbacks"
  dynamic="off"
  entry_id="{stash:section_entry_id}"}

  <h3>{menu_section_title}</h3>

  {menu_section_products}
  <div class="menu-line-item clearfix">

    {title} {item_description}

  </div>
  {/menu_section_products}

{/exp:channel:entries}

Note that I have all of this being cached using CE Cache, so I really only have a major performance hit whenever I have set the cache to break.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.