0

I have a SharePoint site that contains a series of site pages for users across many geograpical areas. Users will open these site pages for the specific areas in order to collaberate. Site pages are accessed via the home page of the site, where there is a 'tile' for each geographical area with an embedded hyperlink

What I would like to do is control what 'tiles' the users can see based off values in a SharePoint list.

I currently have a web part that contains a tile per geographical area (with the hyperlink already embedded in it), where the 'style' has been set to "Display: none". Here is an example:

<a title="Click here to view Area 1" href="/sites/MySite/SitePages/Area1.aspx"> img id ="Area1" img src="/sites/MySite/SiteAssets/Area1.png" data-themekey="#" style="display: none;"/></a>

I have a SharePoint list called lstAccess which contains a list of email addresses and the areas they have access to. E.g.:

Name       Email               Area
User 1     user1@domain.org    Area 1 
User 1     user1@domain.org    Area 3 
User 2     user2@domain.org    Area 2

So my desired end result is, when User 1 opens the SharePoint site, he or she sees the 'Tile' for Areas 1 & 3.

My intention is to use Javascript to then contextually show each 'tile', with code something like this:

document.getElementById("Area1").style.display="inline";

I'm having difficulty with querying my lstAccess to get these desired values. I am currently using SPServices.SPGetCurrentUser() to grab the person currently signed in (which appears to work), but I'm stuck as to where to go from here.

Has anyone tried something similar before? I appreciate this is a non-standard use for SharePoint (a tool for collaberation and not restriction!)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.