Skip to content

Instantly share code, notes, and snippets.

@mreidsma
Last active September 10, 2024 18:06
Show Gist options
  • Save mreidsma/df9d7c8d24489e6395ff4ad578f44140 to your computer and use it in GitHub Desktop.
Save mreidsma/df9d7c8d24489e6395ff4ad578f44140 to your computer and use it in GitHub Desktop.
Add breadcrumbs to GVSU CMS pages - update the links to match needs
(function() {
var parent = document.createElement("nav");
parent.className = "breadcrumbs";
parent.setAttribute("aria-label", "breadcrumbs");
parent.innerHTML = '<ol><li><a href="https://www.gvsu.edu/library">University Libraries</a></li><li><a href="#">Second Level</a></li><li><span aria-current="page">Third Level</span></li></ol><style>nav.breadcrumbs ol { list-style-type: none; margin: 0; padding: 0; } nav.breadcrumbs ol li { display: inline-block;} nav.breadcrumbs ol li a, nav.breadcrumbs ol li span { display: inline-block; margin: 0 .1em; padding-right: .1em; } nav.breadcrumbs ol li:after { content: "\u003E"; } nav.breadcrumbs ol li:first-child { margin-left: 0; } nav.breadcrumbs ol li:last-child:after { content: ""; }</style>';
var cmsContent = document.querySelector('#cms-content > .content');
cmsContent.insertBefore(parent, cmsContent.children[0]);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment