0

when I get summary image in my custom page it will not display and print the name of image with small icon image like that

 echo format_text($course->summary);

enter image description here

1 Answers1

0

You need to rewrite the file URLs. Also, you can use the renderer function to rewrite the file URLs

global $CFG;
require_once($CFG->dirroot.'/course/renderer.php');
$renderer = new coursecat_helper();
$summary = $renderer->get_course_formatted_summary($course);
return $summary;

Or use the below method to rewrite the file in summary.

$context = context_course::instance($course->id);
$summary = file_rewrite_pluginfile_urls($course->summary, 'pluginfile.php',
            $context->id, 'course', 'summary', null);
Prasanna T
  • 169
  • 6