I am trying to create the mobile support for a course format plugin. I use the Delegate CoreCourseFormatDelegate for this.
I wonder how to implement still showing the default mobile frontend Course Page View from the mobile app code 3.5.0 and not use an own template, right now I am rendering the content with a mustache template in the Web Service Callback.
'templates' => array(
'id' => 'main',
'html' => $OUTPUT->render_from_template('format_flex_eduwerkstatt/simple_mobile_course_format', $data),
Thanks Mark, I've been trying to do the same and failed with most part of the code so I guessed it's not possible. I'll have to rebuild the core course format with PHP and then mustache as u mentioned in another thread also.
What I still don't get is, why the Delegate CoreCourseFormatDelegate has those options
when the selector will never show anyway when using the Delegate and having to render the template ourself?
I was wondering this too. I've just worked out that this controls whether the section selector is available through the menu at the top-right of the course page (which also has options for enabling section downloads, downloading the whole course, and viewing the course summary). This is separate from the template you provide for your course format.
A bit of an update on this, while you can't just reuse the whole template, you can reuse the core-course-module component which can save you a lot of time. This very basic example will give you a list of all the course modules from all sections, you can copy more from the core-course-format component's template in the app if you want.
<ng-container *ngFor="let section of sections">
<ng-container *ngFor="let module of section.modules">
<core-course-module *ngIf="module.visibleoncoursepage !== 0" [module]="module" [courseId]="course.id" [downloadEnabled]="downloadEnabled" (completionChanged)="onCompletionChanged()"></core-course-module>