Picture of Matt Leathes
Re: Get Course Title programmatically
by Matt Leathes - Friday, 9 October 2020, 2:00 PM
 

Yes:
Adapt.course.get('displayTitle');
or:
Adapt.course.get('title');
If you want the plain text version. For example, the code that applies the course title to the document (broswer window/tab title) uses the plain text version.

You can also include it in a handlebars template by putting {{import_adapt}} in the .hbs file (usually at the top) then using {{{Adapt.course.displayTitle}}} or {{Adapt.course.title}} where you want to show it.

You can do something similar in the .json files as well, e.g. try adding {{import_adapt}}{{{Adapt.course.displayTitle}}} into the body of a text component.

BTW you haven't said what version of Adapt you're using, I've assumed it's fairly recent but if it's quite old (v2.x) then some of this won't work