AnsweredAssumed Answered

Sub-Accounts and JavaScript

Question asked by Anna Selway on Jan 26, 2016
Latest reply on Jan 29, 2016 by Anna Selway

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

Outcomes