Go back to course

Go back to course

by Paul Lemarchand -
Number of replies: 3

Hello, I would like to add a link to come back to the course from an activity. 

I got this : 

<a class="back-to-course" href=""></a>

body#page-mod-page-view .back-to-course::before { content: url("/paul/pix/arrow-back.png") }

body#page-mod-page-view .back-to-course::after { content: 'Go back to course' }


, with href containing a php trick to get the course url from the activity. 



Usually I try to figure it out myself, but I searched too long for this one, thanks for help ! smile

Average of ratings: -
In reply to Paul Lemarchand

Re: Go back to course

by Mark Johnson -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Hi Paul,

What's your question?  You haven't actually specified what help you'd like smile

It might also be worth me pointing out that there should be a breadcrumb at the top of each page which includes a link back to the course.

In reply to Mark Johnson

Re: Go back to course

by Paul Lemarchand -

Sorry if I wasn't clear :P

I want my href to link to the course page, from an activity inside that course.

Edit: didn't see the last part of your message, would it be that easy Oo will check that out

Edit2: I figured it out :<


(Edited by Helen Foster to remove expressive language - original submission Monday, 18 April 2016, 5:59 PM)

In reply to Paul Lemarchand

Re: Go back to course

by Paul Lemarchand -

If some people come here and need to do the same thing, I did it like that:

href="<?php echo $CFG->wwwroot;?>/course/view.php?id=<?php echo $this->page->course->id ?>"


PS: Sorry if my language was offensive somehow, I see that you edited my previous message