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.

Related Subcategories

January 10, 2012 10:36am

Subscribe [1]
  • #1 / Jan 10, 2012 10:36am

    I’m a total newbie working on a large college site, and we’re using categories to display a list of courses required in a specific program.

    So I’ve got one channel, “courses” that has all the potential classes a major could have, and in each major page, I’d like to show those courses.

    I don’t want to hardcode the category ID in, because I don’t want to replicate the template for every single program.

    Our category structure is 2 layers deep, and goes something like “Undergraduate (accounting, supply chain management), Graduate (accounting, finance)” etc.

    Child categories seem to automatically select their parent category, so the below code is displaying all undergraduate courses, and not just, say, accounting.

    Any ideas about how I could get something that would filter to the subcategories?  Should I be doing something specific with the URL? Is there a better way to be doing this?

    {exp:channel:entries channel="college_of_business_courses" dynamic="off" related_categories_mode="on" custom_fields="yes" orderby="short_course_name|course_number" sort="asc"}
                        
                         <div class="course">
                             {title}
                             {short_course_name} {course_number}
                                {course_description_brief} 
                            </div>
                        {/exp:channel:entries}
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases