Need to modify master page setting but only for 1 site

Manoj Meena asked on March 1, 2019 12:03

We have a search functionality which is part of master page and used by all sites.

however we now need to remove it just for 1 site. if we make it visible as false then it goes from all sites. please help

Correct Answer

Dragoljub Ilic answered on March 1, 2019 12:33

Hi,

You can add a check for that exact site and based on that show/hide search web part. Click on the blue arrow next to 'Visible' checkbox on the web part and add macro:

{% SiteContext.CurrentSiteName != "DancingGoat" |(identity)GlobalAdministrator%}

This will return false only for your site and search web part won't be visible.

Best regards, Dragoljub

1 votesVote for this answer Unmark Correct answer

Recent Answers


Manoj Meena answered on March 1, 2019 12:39

Thank you very much, it worked.

0 votesVote for this answer Mark as a Correct answer

vasu yerramsetti answered on March 1, 2019 12:46 (last edited on December 10, 2019 02:31)

You can handle this using Macro condition on search web part visible property,

{% CurrentSite.CodeName != "yoursitecode" |(identity)GlobalAdministrator%}

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.