Richie JS version 1.1.4 🚀
Course & Carousel

Course & Carousel (Course, ItemList)

What is coursen rich result?

Utilizing course structured data allows you to enhance the information available about your courses, making them more discoverable to potential students through Google Search. This includes specifying the course title, provider, and a brief description.

Kindly Refer Google Doc (opens in a new tab) to know more about course rich result.

What are necessary data for course rich result?

1. Course name

course.html
<div id="rjs-course-1">
    <!-- name of course-->
    <p class="rjs-course-1-name">Python Crash Course</p>
</div>

2. Language

course.html
<!-- name of course with language as data attribute-->
<p class="rjs-course-1-name" data-lang="Tamil">Java Intermediate to Advanced</p>
<!-- OR -->
<p class="rjs-course-1-lang">English</p>

3. Mode of Course

course.html
<p class="rjs-course-1-name">Java Intermediate to Advanced</p>
<p class="rjs-course-1-mode">Blended</p>

4. Instructor

course.html
<p class="rjs-course-1-name">Java Intermediate to Advanced</p>
<p class="rjs-course-1-ins">Peter</p>

5. Description

course.html
<p class="rjs-course-3-desc">This is scratch Course of java</p>

6. Duration with repeatFrequency and repeatCount

course.html
<p class="rjs-course-1-period" data-freq="daily" data-rep="7">1 Months</p>

7. Fees with Currency

course.html
<p class="rjs-course-1-cost" data-currency="inr">2000 RS</p>

8. Publisher name and URL

course.html
<a class="rjs-course-1-purl" href="https://notoracle.com/">
  <p class="pname">Notoracle</p>
</a>

9. Course URL

Richie JS's reserved value on id attribute is mandatory for deeplink or course URL

ID value template is rjs-course-[number]
course.html
  <div id="rjs-course-1">
    ......
  </div>
 
  <div id="rjs-course-2">
    ......
  </div>

Function and parameters

đź’ˇ
By default input file is overwriiten with result so destination is optional
This is only for API method. We prefer CLI method for keeping it simpler (refer - Working with API & CLI).
func_params.js
const richResultType = 'course';
const filePath = 'course.html';
const destination = 'dist/course.html'; /* optional */
 
richie(richResultType, filePath, destination);

Example of a Instance

course_standard.html
<body>
  <!-- course instance 1 -->
  <div id="rjs-course-1">
 
    <!-- name of course with language as data attribute-->
    <p class="rjs-course-1-name" data-lang="English">Python Crash Course</p>
 
    <!-- instructor name -->
    <!-- "By<space>Instructor" can be added or straight forward name in instructor inner text-->
    <p class="rjs-course-1-ins">By Saravanan</p>
 
    <!-- mode of course online|onsite|blended-  Case insensitive-->
    <p class="rjs-course-1-mode">Online</p>
 
    <!-- description -->
    <p class="rjs-course-1-desc">⚠️Intentionally removed for simplicity.</p>
 
    <!-- course duration -->
    <p class="rjs-course-1-period" data-freq="monthly" data-rep="8">68 Hours</p>
 
    <!-- cost of course with currency as data-->
    <!-- digit from innertext is only be taken -->
    <p class="rjs-course-1-cost" data-currency="usd">100 USD</p>
 
    <!-- publisher url with publisher name as innnertext -->
    <a class="rjs-course-1-purl" href="https://lms.com/">
      <p>LMS</p>
    </a>
    <!-- OR 
      publisher url with publisher name as element with id able class name 
    <a class="rjs-course-1-purl" href="https://cresteem.com/">
      <p class="pname">cresteem</p>
    </a> -->
  </div>
</body>

Output of a Instance

course.html
<script type="application/ld+json">
 [
   { 
     "@context": "https://schema.org",
       "@type": "Course",
       "url": "https://www.cresteem.com/pages/carousels/courses#rjs-course-1",
       "name": "Python Crash Course",
       "description": "⚠️Intentionally removed for simplicity",
       "provider": {
         "@type": "Organization",
         "name": "LMS",
         "sameAs": "https://lms.com/"
       },
       "offers": {
         "@type": "Offer",
         "category": "Fees",
         "price": 100,
         "priceCurrency": "USD"
       },
       "hasCourseInstance": {
         "@type": "CourseInstance",
         "courseMode": "online",
         "instructor": { "@type": "Person", "name": "Saravanan" },
         "inLanguage": ["English"],
         "courseSchedule": {
           "@type": "Schedule",
           "duration": "PT68H",
           "repeatFrequency": "monthly",
           "repeatCount": 8
         }
       }
   }
 ]
 </script>


Let's see what's next!