How to change URL of logo link? - continued as old discussion is locked

How to change URL of logo link? - continued as old discussion is locked

by John Joubert -
Number of replies: 0

So - this question was posted, with the only answer thus far being to make changes in code. 

The location of the previous post is: https://moodle.org/mod/forum/discuss.php?d=389047, and https://moodle.org/mod/forum/discuss.php?d=264527, and https://moodle.org/mod/forum/discuss.php?d=384588.

Let's say I have the logo of my moodle site uploaded, but we'd like the click action to take the user elsewhere than the default in Moodle.

The workaround that one of our coders  (a wonderful guy & web programmer - Ryan Letulle)  found was to add a small simple piece of code to the "Additional HTML" tool in Moodle.

Go to Site Administration -> Appearance -> Additional HTML ...

Add this to "Before the BODY is closed"...  just substitute for "yourintendedwebsite.com" the url that you want to go.

The second line of the script will make the page appear in a new window or tab (depends on browser settings).  Just remove that second line if you want the page to pop open in the same browser tab/window.,

<script>
$("#logo a").attr("href", "http://www.yourintendedwebsite.com/") ;
$("#logo a").attr("target", "_blank") ;
</script>

PLEASE MAKE SURE to test in different moodle screens and ALSO in different browsers in a DEV environment first!!!

Average of ratings: -