How can I hide entries depending on which category they are associated with? Right now, I have a staff profile page. Each person on the page has a category association (professional, leadership, student). When the students graduate, I want to add an 'alumni' category to their entry, and have them stop showing up on the active page. Right now I have student and alumni associated with the particular entry, and I want to hide all entries with the alumni category. Any idea how to go about this?

{% set leaderGroup = craft.categories.group('staffHierarchy').slug('leadership') %}
{% set leader = craft.entries.section('people').relatedTo(leaderGroup) %}
{% set staffGroup = craft.categories.group('staffHierarchy').slug('student') %}
{% set staff = craft.entries.section('people').relatedTo(staffGroup) %}
The search parameter will help you do this really elegantly.

In the code below I've called the category field categoryField, but you'll have to swap that to suit your site.

{# Get current students (students who aren't also in the alumni category) #}
{% set currentStudents = craft.entries.section('people').search('categoryField:student -categoryField:alumni') %}

{% for student in currentStudents %}
    {# Output your students here #}
{% endfor %}


This is basically asking Craft to respond with the entries that have the categoryField including student but not (indicated by the - before) including alumni.

You could probably also streamline the other bits of your code using this method.

I've tested this as working on Craft 2.5.2757

Hope that helps!