The system we ended up with was as follows:
- Student clicks a logo to log in and enters their login details.
- Student is presented with a picture of their teacher which they click.
- Student is taken to their class page.
When staff log in, they are presented with the pictures of all the teachers whose class areas they have access to plus any communal areas such as the Staffroom area.
By default, Uniservity will customise the standard Navbar depending on who is logged in and will only show them links to areas and resources they have the permissions to access. If you want to have more control over how the Navbar looks, and aren't happy with simply using Custom Images for the groups and having gaps between them (yuk!), you are stuck with a static Navbar which is not customised to the user's access permissions. This is fine for resources as, if these are linked to manually from class pages, a user will only see them when and if they get to the class page. So what is needed is a way either to customise the Navbar independently of Uniservity's standard functionality, or to do away with the Navbar completely and use graphics on the page which are customised to the user's permissions.
You will notice the iframe tag here, which creates a window (in this case an invisible one) into another webpage. The style properties set the frame which appears around the edge by default to zero pixels so that it is invisible (as well as the frameborder="0" attribute). Also being set is the width of the iframe, which is made to be 100% of the width of the window (in this case the central area of the Uniservity page), and the scrollbars which are turned off so that the iframe is completely invisible and it appears as though the content coming from the source page is simply on the page with no frame. The source page is referred to by the src attribute, and this URL is the URL of the manually created and uploaded webpage I made reference to above.
The magic part of this is the part which starts onerror=. This is what is called an event handler and it is basically saying that if an error is thrown up when trying to load the image concerned (such as it isn't accessible), do something. The something it does is to change the style properties of the image to make it invisible and have zero width and height. That means that if the image does not load, it will not display at all. You can see how this could be used in a Custom Navbar to acheive what the inbuilt Uniservity system does but with much more flexibility in what the Navbar actually looks like.
Please note that I have never tried this code directly in a Custom Navbar, so I don't know whether it will work without being stripped out. In my experience, the Custom Navbar box is a lot more forgiving in terms of what it will allow, so the chances are it would work. If not, you could always use an iframe as in the example above and create the code for the Custom Navbar outside Uniservity then upload it as a resource.