2

How can you create a back button link in the top menu bar. My SharePoint is kind of tedious and I'm not sure I know all the rules about what code can be used. Sorry if this questions has been asked before. I tried googling it but didn't find any code that worked for me.

I would like it to be added at the top menu(not the very top, but below the browse, page, share follow bar where you can add links) this adds another challenge as it does not offer the option to add as web part. Thanks in advance.

I do not have sharepoint designer(I'm using the web interface), this is for SharePoint 2013.

2

If you download and edit the Masterpage through the web UI, you could add a button or link that goes back one page.

The button could look like anything as long as it calls a function like:

function goBack(){
    history.go(-1);
}

Source

Then you re-upload the Masterpage with the same file name.

When making the button/link you can either place it directly on the Masterpage or use Javascript/jQuery to get it in the correct place.

Edit:

I have looked into the global nav and I cannot see a way to add javascript to it.

I do have one hackish thought though. You can go to the navigation page (/_layouts/15/AreaNavigationSettings.aspx). And create a link to a new page. On that page add a script editor web part and in the script web part add:

<script type="text/javascript">
history.go(-2);
</script>

You will go to the new page then back 2 pages.

Edit 2:

To bypass the issue where you cannot get to the page, you can change the javascript to look like:

if(!(document.forms[MSOWebPartPageFormName].MSOLayout_InDesignMode.value == "1" ||
location.href.indexOf("viewPage") != -1))
  history.go(-2)

To navigate to the page add "?viewPage=1" to the url. Another restriction is that if there are not 2 pages to go back, it will go nowhere.

3
  • I'm not able to download and edit the Masterpage. I don't have that level of access I believe.
    – Jeff
    Jul 14 '14 at 16:24
  • I realized that you answered my question perfectly. I then realized that I didn't describe my problem correctly. I will revise my question.
    – Jeff
    Jul 14 '14 at 21:39
  • I gave that a shot, but I didn't work as expected. kind of gets stuck, also makes editing the file difficult. But I like the thought, very good idea.
    – Jeff
    Jul 15 '14 at 20:38

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.