I am wondering if we are able to use tiles of the promoted links to hide certain web parts of the same page. For example, when they click on a tile, one web part will be hidden on the same page. Is that possible?

1 Answer 1


Hiding parts of the page can be done - especially if you are using web parts that should be displayed/hidden.

Create a page with one or more web parts on it. Press F12 in Internet Explorer to start developer tools. Use "DOM Explorer" and activate DOM highlighting and select one of your web parts to toggle. You can see the element ID in source code - for example something like 'MSOZoneCell_WebPartWPQ4'.

So now assuming you want to have this hidden when entering the page and have a button to activate and again hide it - create a text file in text editor.

Copy the following into the text file and save it. Please do not forget to replace the id of your element!

<script type="text/javascript" language="JavaScript">
var i = 0;
function toggle(a)
var e = document.getElementById(a);

// element exists
if(!e)return true;

  // switch

return true;

function test()

var x = document.getElementById('MSOZoneCell_WebPartWPQ4');

x.style.display ="none"



<style type="text/css">



<a href="#" onclick="return toggle('MSOZoneCell_WebPartWPQ4')">click here to toggle the webpart</a>

Now upload this textfile to SharePoint - maybe SiteAssets. Copy the hyperlink to this file, edit the page you want to toggle contents, add a CEWP (content editor web part), edit the web part and in web part properties add the hyperlink to the text file. After saving you will see your web part is hidden and a text "click here to toggle the web part" gives you the option to have it shown and hidden again.

You can modify this script to multiple web parts and to look more nice.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.