Created
August 8, 2013 21:55
-
-
Save mikebuchanon/6189143 to your computer and use it in GitHub Desktop.
Example of how to shove link into Moodle breadcrumbs via HTML/JavaScript...can be used with an 'invisible' HTML block
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript">// <![CDATA[ | |
var breadcrumb = document.getElementsByClassName('breadcrumb'); | |
var li = document.createElement('li'); | |
var a = document.createElement('a'); | |
var linkText = document.createTextNode("my title text"); | |
var sep = document.createElement('span'); | |
var septext = document.createTextNode("/"); | |
sep.appendChild(septext); | |
sep.className = "divider"; | |
a.appendChild(linkText); | |
a.title = "Test Portfolio"; | |
a.href = "http://example.com"; | |
li.appendChild(a); | |
li.appendChild(sep); | |
breadcrumb[0].insertBefore(li,breadcrumb[0].childNodes[0]); | |
// ]]></script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment