Sharepoint Forum

 
Home » Forum » Sharepoint       Ask a questionRSS Feeds

Link an area to its document library directly

  Asked By: Bob Bolton         Date: Jul 12, 2006      Category: Sharepoint      Views: 343
 

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
http://myServer/Reference%20Library/default.aspx.

But my customers request that the area link leads
directly to the document library:
http://myServer/Reference%20Library/Reference%20Library%20Documents/Forms/AllIte\
ms.aspx

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

Tagged:                

 

14 Answers Found

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

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, 2006       

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, 2006       

try this
<HEAD>
<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";
}
else
{
window.location="http://www.yahoo.com" target="_blank" rel="nofollow">http://www.yahoo.com";
}
//-->
</SCRIPT>
</HEAD>

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

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, 2006       

i guess....append, contents=1 to the URL....to goto web part maintenance page
example
localhost/C7/Google1/default.aspx?contents=1

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

I forgot the powerful ?contents=1!

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

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.

<script>
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
}else{
// Redirect
if(window.location.replace)
window.location.replace("http://www.google.com" target="_blank" rel="nofollow">http://www.google.com");
else
window.location="http://www.google.com" target="_blank" rel="nofollow">http://www.google.com";
};
</script>

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, 2006       

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, 2006       


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
"/PortalAreaName/Document%20Library%Name/Forms/AllItems.aspx".

This will automatically handle the redirect for you without JavaScript.

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

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, 2006       

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, 2006       

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, 2006       

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, 2006       

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.


Your Answer
  • Answer should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].