Accessing course ID in custom theme code

dkpatton
Community Participant
Our custom themes do a little bit of customization on the home page of courses. One change depends on the course ID of the page. There are plenty of ways to get the course ID in the web browser, for example:
  • document.querySelector('body').classList.toString().split('context-course_')[1].split(' ')[0]
  • ENV.COURSE.id
  • ENV.COURSE_ID
  • window.location.href.split('/courses/')[1].split('/')[0]

However, none of the above methods work in the mobile app. Does anyone have a way to get the course ID from a page on the mobile app?

Labels (4)
0 Likes