0

I have a search center site and on the results.aspx page, I am displaying results based on a search query. I actually have a master page applied and using the approach mentioned here: http://changecase.net/blog/2014/04/04/link-your-site-logo-to-your-root-homepage-in-sharepoint-2013/ , I applied the code accordingly and now on all the subsites, when clicked on the logo it takes me to the top level site.

But on the results.aspx page of the search center site, if i click on the logo, it takes me to the home page of search center site and I want to change this to point to Root of the site collection, below is the code I tried to use in the master page but it does not work, can someone please help me with the solution.

<script src="https://code.jquery.com/jquery-1.12.4.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#ctl00_PlaceHolderLeftNavBar_onetidProjectPropertyTitleGraphic").attr("href","https://triangleequities.sharepoint.com");
});
</script>
1

Are you sure that the search center and your content sites are using the same master page? As I recall it the search center uses Oslo and the default publishing sites uses Seattle

  • They are using the same since search center is inheriting the master page parent uses. Thanks. – mdevm Jun 2 '18 at 10:42
0

After some research, I was able to achieve it. Just used my Jquery skills and put the snippet into a Script editor web part and it works fine now. See below code for reference. I hope it helps someone.

<script type="text/javascript" src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script type="text/javascript">
$(document).ready(function() {
    $("#ctl00_PlaceHolderLeftNavBar_onetidHeadbnnr2").click(function(){
        $("#ctl00_PlaceHolderLeftNavBar_onetidProjectPropertyTitleGraphic").attr("href","https://*****.sharepoint.com");
    }); 
});
</script>

Your Answer

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

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