Call 1-888-670-1652

 Spire CoreDB Connect Error (2002) Connection timed out

Creating a Class Schedule

Goal
To create a schedule of classes in the news module and link each class to a course and to have on the course page a list of scheduled classes onoy for that course.

Step 1- Creating a new Data Type
Go to the news module > setup > Data types and create a data type called "courses"

Step 2 - Create Course Pages in CMS
In content management create a page for each course. Each page should have a common base path. For example /courses/
Exapmple of full urls for each course
/courses/course1/
/courses/course2/

In the content of each course page you need to add this tag
<sys:news-list news-type="NT1" design="list" display-content="yes" content-design="content" order-by="start_date" order-dir="asc" filter="course=course1"/>

You will need to change the news-type to the proper section of the news module
For each page change the last variable "course" to the last part of the url.

Step 3 - Enter all Courses into the Data Type
Once all the course pages have been completed and this tag added, you need to go to the news module > setup > Data types
Click on the new data type you previously created called courses.

In here you need to add all the courses where the foreign key is the last part of the url without a slash. Do this for every course.


Step 4- Add new Data Type to the Admin Design
News > Setup > Object types section click on the section that contains the training layout. In the designs section, click on the edit link to edit the xslt for that section. The following code needs to be added to the xslt in the appropriate section. This code will show up in the administration as a pull down menu of courses.

<p>
<xsl:choose>
<xsl:when test="string-length(field[@id='course']/@value) &gt; 0">
<a href="/courses/{field[@id='course']/@value}/"><xsl:value-of select="short-subject"/></a>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="short-subject"/>
</xsl:otherwise>
</xsl:choose>
</p>

Step 5 - Choose the Correct Course for Each schedule Class
For each scheduled class you should now see a pull down of the courses you created. Choose the correct course for each class and save.

Step 6 - Create Page to Show all Courses
Place this tag on the course list page

<sys:news-list news-type="NT1" design="list" display-content="yes" content-design="content" order-by="start_date" order-dir="asc"/>