function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Swaggy BSwaggy B 

Hide search bar based on ProfileID in community

Hello I was trying to hide the search bar in the community based on the Id I have some Jquery that I am able to inject in the footer to get rid of the search bar but i am having problems doing it based on the profile Id. 


<html>
<head>
    <meta charset="utf-8">
    
</head>
<body>
<script src="//code.jquery.com/jquery-1.11.2.min.js"></script>
<script src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script>

    

<script type="text/javascript">
/* Hide the top search box */

var j$ = jQuery.noConflict();

j$(document).ready(function(){

if('{!$User.Profile}' == 'Windstream Community User'){

j$("#phSearchContainer").hide();
}
}); 

</script>
</body>
</html>
 
KevinPKevinP
I suspect you actually want to use: 

{!$Profile.Id}