Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

is it possible to create a link on a page to a library within the same page. So for example, I have a small list of 8 categories on my page, when i click on the first category "Governance" I would like to be taken to the Governance web part (library) on the same page. Am I making my self clear? thanks, Colin

share|improve this question
1  
Are you talking about Anchor tags as Bookmarks ? –  Arsalan Adam Khatri Oct 24 '12 at 7:27
add comment

1 Answer

You could solve this with a relative url, so if it's a list you do this:

Lists/MyList

or if it's a library:

mylibrary/

This is the simple solution, and will only work if you are located on the "top" of your SPWeb. If your question was about codebehind (C#) then the URL can be resolved.
The URL can also be resolved with Client Object Model in JavaScript, like this:

var ctx = new SP.ClientContext();
var site = ctx.get_site();
var list = ctx.get_web().get_lists().getByTitle('UrlTest');
ctx.load(list);
ctx.load(site);
ctx.executeQueryAsync(function() {a=site
  console.log(site.get_url(), list.get_defaultViewUrl());
});

here site is not necessary, as list.get_defaultViewUrl() will return a root relative URL (starting from /), but I decided to add it to show how to get absolute URL.

share|improve this answer
    
it is mylibrary/ , however, I am developing the front end and am not a programmer. So perhaps this is too deep for me. I am trying to build a Table of Contents for my Library parts on the same site page. So when they click on Chapter 1, it will take them to the Library, or book mark. –  Colin Oct 24 '12 at 18:05
    
So adding a link manually in a content editor web part or similar should do the trick? –  eirikb Oct 24 '12 at 20:51
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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