I posted this information on the Get The Point Blog some time ago but I’ve had several folks say they didn’t quite succeed at getting it going (they forgot to check in published pages, etc.). It was here: http://sharepoint.microsoft.com/Blogs/GetThePoint/brainlitterarchive/Lists/Posts/Post.aspx?ID=381
Well, I’ve done one better and posted it on my own blog complete with a video showing how it is done…
Video Link: http://youtu.be/m5_Ey6duiss
This video demonstrates how to:
- Start with a blank SharePoint 2010 Enterprise Search Center
- Create a content editor web part with the appropriate HTML in it (and below)… You may want to override where ‘home’ is, but the "back" functionality should stay. As well, it utilizes icons that can be found in every SharePoint installation, but you could of course create your own
- Export that content editor web part to your PC as a DWP file so you can reuse it
- Import it into your Web Part Gallery (site collection settings, Web Parts) and categorize it for easy reuse
- Apply it to the remaining pages that make up the functionality of the Enterprise Search Center
- Check In the pages and make them major versions so all of your users can see/use them
The following is the code you will want to paste into your Content Editor Web Part
1: <br/> <a href="/"><img class="ms-rtePosition-4" alt="Go Home" src="/_layouts/images/hhome.png" border="0"/></a> <font color="#0072bc"><a href="/">Go Home</a> </font><a onclick="history.go(-1)" href="#"><img class="ms-rtePosition-4" alt="Go Back" src="/_layouts/images/back.gif" border="0"/></a> <a onclick="history.go(-1)" href="#">Go Back</a><br/><br/>
This has been a popular topic among folks who want to leverage SharePoint Search but find the out of the box minimal.master page unfriendly for getting back to the rest of your SharePoint sites. http://sharepoint.microsoft.com/Blogs/GetThePoint/brainlitterarchive/Lists/Posts/Post.aspx?ID=381
Hi, Thanks for the post!
I need to setup the Link “Go Home” merging with the name of the current user.
Like this:
http://companyweb/“currentuser”
Can you help me?
Thanks
Hi Flavio,
Please see my post on http://yalla.itgroove.net/2012/07/sharepoint-current-username-add-username-to-page/ for a possible way to achieve what you are asking.
Hi Keith Tuomi,
Thank you a lot for you post!!!. It’s not working for me,I think I’m missing something. I’m using web part “Content Editor” to execute this javascript. The hyperlink was created, but it takes me just to my home page, http://companyweb
This is the code that I past on the content editor:
function getUserName()
{
var thisUser = $().SPServices.SPGetCurrentUser({
fieldName: “Name”,
debug: false
});
return(thisUser)
}
document.getElementById(‘myAnchor’).innerHTML=”http://companyweb/” + getUserName() + “/”;
http://companyweb/
You will need to ensure that you have a copy of the SPService .JS included in your site and referenced properly. All the details for accomplishing this are on http://spservices.codeplex.com/documentation#general-instructions.
Additionally, in the original example on my blog post it just modified the anchor text of the hyperlink. To modify the URL as well you would need to change the href attribute of the link as well.
I updated my blog post on http://yalla.itgroove.net/2012/07/sharepoint-current-username-add-username-to-page/ to include examles of referencing Jquery and SPServices, and the main script now includes the href update.
Hi … This is really Great, However if you use the seach feature which is on the top bar of Home, you will not get these Home & Go Back links in the result page, and when I’ve tried to edit it, I couldn’t find “Edit Page” Option … would you please give hand in this
Thank you
Thanks a lot for this post.