cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
anna_selway
Community Participant

Sub-Accounts and JavaScript

Jump to solution

Hello

A little while ago I asked how to add links to the global navigation bar in Canvas

Links new Canvas UI

This works brilliantly and thank you for all your help.  The code we are now using in our instance is:

function addMenuItem (linkText, linkhref) {

    'use strict';

    var iconHtml = '',

        itemHtml,

        linkId = linkText.split(' ').join('_');

   

    itemHtml = '<li class="ic-app-header__menu-list-item tempRemoveClass">' +

        '  <a id="global_nav_' + linkId + '" href="' + linkhref + '" class="ic-app-header__menu-list-link">' +

        '       <div class="menu-item__text">'  + linkText + '</div>' +

        '  </a>' +

        '</li>';

    $('#menu').append(itemHtml);

}

addMenuItem('Induction', 'https://highbury.instructure.com/enroll/FF96T9');

addMenuItem('Student Central', 'https://highbury.instructure.com/enroll/4YTHFN');

addMenuItem('PLP', 'http://hplp-portal.com/log-in');

I now have a new question I would like to customise a sub-account so the links do not appear, we have got this functionality switched on in Canvas.  So as I understand it I will need to upload a javascript file for the sub account that removes the above links.

If anyone could help me to achieve this I would very grateful.

Thank you

1 Solution

Accepted Solutions
anna_selway
Community Participant

Hello my son has helped me out - to remove the links in the sub account, you need to open the sub account theme editor and upload the following js

$("#global_nav_Induction").hide();

$("#global_nav_Student_Central").hide();

$("#global_nav_PLP").hide();

Hope this helps

View solution in original post

3 Replies
Stefanie
Community Team
Community Team

anna.selway, I have shared this highly specialized question with the Canvas Admins and User Group: New UI​ groups. If you're not already a member of those groups, joining is just a few clicks away.

anna_selway
Community Participant

thank you 🙂

anna_selway
Community Participant

Hello my son has helped me out - to remove the links in the sub account, you need to open the sub account theme editor and upload the following js

$("#global_nav_Induction").hide();

$("#global_nav_Student_Central").hide();

$("#global_nav_PLP").hide();

Hope this helps

View solution in original post