I am trying to create three seperate class schedules based on three different locations. The approach I am using almost works but I am stumped on how to get it to do exactly what I need. This may not be the best approach so I am open to any other suggestions that may work. Hopefully I have provided enough information to make sense.
Background:
There are 3 business locations that offer classes. Each location will have a unique class schedule.
Objective:
Display 3 seperate schedules; one for each location (i.e., East Location, South Location, North Location).
Data Breakdown:
Categories are courses (i.e.,BEGINNING, INTERMEDIATE, ADVANCED, etc.)
The weblog is made up of each individual class offered AND the LOCATION. Some classes may not be offered at all locations.
example of class data:
220 TUE 11:00-12:00 SOUTH LOCATION
301 MON 12:20-1:45 NORTH LOCATION
Problem:
I only want to display the category names for classes being offered at the location I am displaying the scheudle for.
For example, the North Location only offers an ADVANCED course. When I display the North Location schedule, I would like it to look like this:
ADVANCED
301 MON 12:20-1:45
What I am getting is:
BEGINNING
INTERMEDIATE
ADVANCED
301 MON 12:20-1:45
Note that there is a BEGINNING and INTERMEDIATE class being offered at other locations. So the code below produces the above results correctly, I just need to take it one step farther.
The code:
{exp:weblog:category_archive weblog="schedule" style="linear" show_empty="no"}
{categories}
{!-- Display the category name --}
{category_name}
{!-- Display all weblog entries for this category --}
{exp:weblog:entries weblog="schedule" category="{category_id}"}
{!-- Display classes for North Location only. All classes at North Location range between 301-399. --}
{if {class-number} > 300 && {class-number} < 400}
.
.
display class info
.
.
{/if}
{/exp:weblog:entries}
{/categories}
{/exp:weblog:category_archive}NOTE: show_empty=“no” works if no class is being offered at any locations. There is a BEGINNING and INTERMEDIATE class being offered at other locations so the category is not empty and thus the extra categories will be displayed.