public function is_editing_the_frontpage() {
        // There are some conditions to check related to contexts.
        $ctxconditions = $this->page->context->contextlevel == CONTEXT_COURSE &&
            $this->page->context->instanceid == get_site()->id;
        $issiteindex = (strpos($this->page->pagetype, 'site-index') === 0);
        // So now we can be 100% sure if edition is happening at frontpage.
        return ($ctxconditions && $issiteindex);
    }