Hi Felicia,
I used the jQuery selector $('menu li:last') to select the last <li> in the menu object and the jQuery .before() method to insert before it.
I used an svg from Canvas since I had a lot of trouble trying to figure out sizing other svgs (using source addresses instead of the path tag). I never quite figured out using the height/width and viewBox properties.
addFollettButton();
function addFollettButton() {
$('#menu li:last').before('<li id="custom_nav" class="menu-item ic-app-header__menu-list-item">' +
'<a id="global_nav_resources_link" class="ic-app-header__menu-list-link" href="https://humboldt.edu" target="_blank">' +
'<div class="menu-item-icon-container" aria-hidden="true">' +
'<svg xmlns="http://www.w3.org/2000/svg" class="ic-icon-svg ic-icon-svg--follet" version="1.1" x="0" y="0"' +
'viewBox="0 0 46 45" enable-background="new 0 0 46 45" xml:space="preserve">' +
'<path d="M8.9,21l2.1-2.1l-0.7-0.7l4.8-4.8l-2.1-2.1l-4.8,4.8l-1.1-1.1l4.8-4.8L9.9,' +
'8.2L5.1,13l-1.8-1.8l7.9-7.9l7.8,7.8L21,8.9l-8.2-8.2c-0.4-0.4-1-0.7-1.6-0.7c-0.6,' +
'0-1.2,0.2-1.6,0.7L0.7,9.5c-0.9,0.9-0.9,2.4,0,3.3L8.9,21 M45.3,32.3L37.1,24L35,26.1l7.8,' +
'7.8l-7.9,7.9L33,39.9l4.8-4.8L35.7,33l-4.8,4.8l-1.1-1.1l4.8-4.8l-2.1-2.1l-4.8,4.8L27.1,34L25,' +
'36.1l8.3,8.3c0.4,0.4,1,0.7,1.6,0.7c0.6,0,1.2-0.2,1.6-0.7l8.8-8.8C46.2,34.6,46.2,33.2,45.3,32.3 M45,' +
'10.4c0-1-0.4-1.9-1.1-2.6l-6.7-6.7C36.5,0.4,35.6,0,34.6,0S32.7,0.4,32,1.1L4.3,28.8c-0.6,0.6-0.9,1.3-1,' +
'2.1L0.1,43c-0.1,0.5,0,1.1,0.4,1.5C0.8,44.8,1.2,45,1.6,45c0.1,0,0.3,0,0.4-0.1l12.2-3.2c0.8-0.1,1.5-0.5,' +
'2-1L43.9,13C44.6,12.3,45,11.4,45,10.4L45,10.4z M4.1,40.9L6,33.8l5.3,5.3L4.1,40.9L4.1,40.9z M41.8,10.7L14.6,' +
'37.8l-7.5-7.5L34.3,3.2c0.2-0.2,0.3-0.2,0.4-0.2c0.1,0,0.3,0,0.4,0.2l6.6,6.6c0.2,0.2,0.2,0.3,0.2,0.4C41.9,10.4,41.9,10.6,41.8,10.7L41.8,10.7z"/>' +
'</svg>' +
'</div>' +
'<div class="menu-item__text"> Follett\nDiscover' +
'</div>' +
'</a>' +
'</li>');
}
Hope this helps!
This discussion post is outdated and has been archived. Please use the Community question forums and official documentation for the most current and accurate information.