Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Link an area to its document library directly

  Asked By: Bob    Date: Jul 12    Category: Sharepoint    Views: 1642

I am looking a way to link an area to its document
library directly.

On my portal, I have an area "Reference Library" which
contains a document library.

Currently, the area link leads to

But my customers request that the area link leads
directly to the document library:

Is there a way to do this? Like modifying SPSTOPIC
area template?



14 Answers Found

Answer #1    Answered By: Laura Walker     Answered On: Jul 12

Can you display the document  library web part on the area? If that
won't make them happy, you can always add a little JavaScript redirect
code in a Content Editor Web Part on the area  page to automatically take
you to the library  AllItems.aspx page.

Answer #2    Answered By: Christop Mcfadden     Answered On: Jul 12

What's the right syntax to add Javascript code in a
Content Editor web part? In its Source Editor?

Answer #3    Answered By: Victoria Bell     Answered On: Jul 12

try this
<SCRIPT language="JavaScript">
var browserName=navigator.appName;
if (browserName=="Microsoft Internet Explorer")
window.location=" http://www.yahoo.com" target="_blank" rel="nofollow">http://www.yahoo.com";
window.location="http://www.yahoo.com" target="_blank" rel="nofollow">http://www.yahoo.com";

Answer #4    Answered By: Cassidy Sharpe     Answered On: Jul 12

But then I have problem to go back to edit the
redirect link. Whenever I visit the site, even with
"?Mode=Edit&PageView=Shared", the page goes directly
to to redirected page. How do I ever get back to the
content edit web part editing page?

Answer #5    Answered By: Linda Mason     Answered On: Jul 12

i guess....append, contents=1 to the URL....to goto web part maintenance page

Answer #6    Answered By: Hans Weiss     Answered On: Jul 12

I forgot the powerful ?contents=1!

Answer #7    Answered By: Damon Garner     Answered On: Jul 12

This is the area  redirect script that I use.. I would avoid adding the extra <Head</Head> tags in the previous message as that would create malformed HTML (An HTML document  should only have 1 Head section). Also - the check for the browser type is usually to determine if it can use location.replace.. The original script provided does not benefit from checking the browser type because it ended up doing the same thing.. This script also checks for a query string character (?) or bookmark character (#) and if it finds one it doesn't perform the redirect. This way you can just add either of those characters to the original URL and can still go in and modify the redirection CEWP.

var httpHeader="http://";
var httpReferrerIndex=location.href.indexOf(httpHeader);
var query = (location.href.indexOf("?")+1);
var query2 = (location.href.indexOf("#")+1);

if(query>0 || query2>0)
// No Redirect
// Redirect
window.location.replace("http://www.google.com" target="_blank" rel="nofollow">http://www.google.com");
window.location="http://www.google.com" target="_blank" rel="nofollow">http://www.google.com";

I got this excellent script from: www.sharepointblogs.com/.../3298.aspx

The first 2 variables aren't really used above, but you could use them to quicky concatenate them with the path for your document library  view page url.

Answer #8    Answered By: Freddy Heath     Answered On: Jul 12

With that trick, I can go back to editing with
"?Mode=Edit&PageView=Shared", without deleting the web
part from "?Contents=1" and re-add it for editing.

Answer #9    Answered By: Joanna Dixon     Answered On: Jul 12

It sounds like you got this resolved before I could chime in, but if you
want to try another solution, go to the portal area  main page, and go
into Change Settings from the Actions menu. In the page tab, modify the
page tab to

This will automatically handle the redirect for you without JavaScript.

Answer #10    Answered By: Gopal Jamakhandi     Answered On: Jul 12

I've been confused by the:

This area  uses the following page as a template

..setting on the Page tab of the area settings.

If I select another area as a template, it doesn't really create a
new area with the other area as a template. It just takes you to
the other area. When I make a new list, it goes in the other area
and when I add list items, they go in the other area and when I
switch it back, they disappear and remain only in the other area.

Does this make sense?

Answer #11    Answered By: Christop Mcfadden     Answered On: Jul 12

Just a quick question: how to get back to the "Action
> Change Settings" page from the redirected area  page?

Answer #12    Answered By: Cory Brooks     Answered On: Jul 12

Go to Manage Portal Site in the Actions menu, navigate to the area  and
right click to delete the area. Then recreate and change settings.

Answer #13    Answered By: Ruth George     Answered On: Jul 12

Did you mean "From any other area  page, Go to Manage
Portal Site in the Actions menu, navigate to the area
and right click to edit the area. Change settings on
the page tab"?

Answer #14    Answered By: Peter Peterson     Answered On: Jul 12

That will work too!!!!!!!!!!!!!!!

Didn't find what you were looking for? Find more on Link an area to its document library directly Or get search suggestion and latest updates.