Wednesday, February 18, 2015

How to redirect to root site when user click on subsite logo

Requirement:

I have one sub site (this is search center) under the root site collection. Whenever search any keyword it will redirect to search site. Here there is no way to go to home site. Now users want to go back when they click on site logo.

Solution:

Here the solution.

1. Open the sub site/ Search site in SharePoint designer 2013.
2. Open the site's master page and add the below JQuery script.

<script type="text/javascript">
$(function(){
  $('.ms-siteicon-a').click(function(e){
   e.preventDefault();
    window.location.href="/";
  });
});
</script>

Now save and check it.


No comments:

Post a Comment