Links in a document library
I am developing a document library where resources/documents can either be 'real' documents or just links to documents on the web. Is it possible to have this kind of amalgamation (both links and documents) inside document library?
If I remember it correctly, ultimately SharePoint stores the hyperlinks to documents in its fields and the actual content is stored in content database. If that is right, then I should be able to programmatically add links or document to the library. I just wanted to make sure that only real documents are allowed in the document library.
Another option would be to create a separate links library besides document library which I do not like because I will end up developing more custom code.
Thanks!
Hi Diffident,
What i will suggest you is that, you must create a new link column(custom column) in the same document library where you want to upload the documents and want to keeps the links as well. For that, go to document library -> Library Tab on
ribbon -> Library Settings then create a custom column.
So whenever you upload a document, you will have to mentioned the additional details.
Regards,
Malkeet Singh
If a post answers your question, please click Mark As Answeron that post and
Vote as Helpful
Similar Messages
-
In summary, I have created 3 document libraries and one issues list in a site collection.
The issues list has a form that has mainly been created in SharePoint 2010 but tweaked in InfoPath 2007 and one of the fields links to the title of a document in the first document library (so an issue can be linked/referenced to a particular document).
This all works great until I want to move a document (using the workflow that I built) from document library 1, to document library 2 or 3 as this is what I've set up to move documents through the business process we are taking it through.
When this happens, the link between the issue that was raised originally against the document is broken and therefore you can no longer tell which document the issue is linked with.
Does anyone know a way of 'setting' the field that is linked to data in another document library on original selection/creation of the issue, so that when the link is broken the original data remains.
Any ideas welcome as I am stomped!!!
Cheers!!
Louis Maxwell
Hi Louis,
According to your description, my understanding is that you want to keep the link field of the issue list working after moving the linked document.
Whether the link field is a lookup column or not ?
If so, due to the information source of lookup column cannot be changed, you need to add other lookup fields for document library 2 and document library 3. Just one lookup column corresponds one document
library. Then you can update the lookup column in the workflow when move the linked document. Such as when a document is moved to document library 2, you need to clear the lookup1 field (corresponding document library 1) and update the lookup2 field (corresponding
document library 2).
For updating the lookup column, you can refer to the following actions:
Best Regards,
Eric
Eric Tao
TechNet Community Support -
Link from Document Library to UNC Path
Can anyone tell me if it is possible to create a link from a document library to a UNC path?
I need to establish links to resources in an existing document repository, but Sharepoint presents the following message when attempting to add the link "Enter a valid document name and URL. Valid URLs must begin with 'http:' or 'https:'"
Thanks in advance.
DaveFollowing are the steps to achieve this.
1) Create a site content type of type "link to a document" with "Document" as a parent content type.
2) Add the same to the document library.
3) Go in the layouts folder open newlink.aspx in Visual Studio IDE
4) add the following function to the script tag
Code Snippetfunction HasValidUrlPrefix_Override(url)
var urlLower=url.toLowerCase();
if (-1==urlLower.search("^http://") &&
-1==urlLower.search("^https://") && -1==urlLower.search("^file://"))
return false;
return true;
5) Replace "HasValidUrlPrefix" to "HasValidUrlPrefix_Override" in the newlink.aspx
6) IISReset and when adding a link to a file share. It shoudl be done in the following format "file://\\{ComputerName}\\}FileName}" it should work
7) Change the wss resource file present in app_globalresources to show the following message "Enter a valid document name and URL. Valid URLs must begin with 'http:' or 'https:' or 'file://'"
Hope this should help.
Regards,
Mayur -
Link to Excel document in site throws "Document with same name already open"
I have an Excel document stored in a document library in SP2010. I provided a link to the document in a CEWP on a page. When clicking the link on the page, Excel throws the erorr "Two documents with the same name cannot be opened" error.
When clicking the link in the document library, the Excel workbook opens fine. When hovering over both links, the URL in the status bar is identical. Here is the link in the page:
<span style="width:120px; padding-right:50px;">
<a class="ms-addnew" href="https://mydomain.com/sys/groups/ermcg/RA/Shared%20Documents/RA1.xlsm">
<img src="https://mydomain.com/sys/groups/ermcg/RA/SiteAssets/excelsmall.jpg" style="border:none;vertical-align:middle;"></img> Download to Excel</a>
</span>
Thanks in advance,Hi jd_hancock,
The scenario is not reproduced in my environment.
I used Fiddler to check whether there are differences between them to download the file, it seems the same and the file also successfully opened in the Content Editor Web Part.
I would suggest you to use the same way to check whether the download process is the same, also, type the url directly in the address bar, whether the document can be opened as expected?
Thanks,
Qiao
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected]
Qiao Wei
TechNet Community Support -
Setup a template document in a SharePoint document library
I created a template for a document library in SharePoint Online. I configure it so when the user needs to open a new document the template opens. It works if you go to Files\New Document, but if you click on the New Document link
in the document library when you select word the default template opens. How can I get the new document link in the document library to open the template document that I created?
Thanks
JudyIts simple.. Go to the document library template which you have created. Then go to its library settings. Then go to advanced settings and select allow management of content type to yes. Then try to click ok and scroll down to find the option add from
existing site content types and then add your template which you have created and click ok. Once you have done that you will be able to see the option of that template when you click new. If you still don't get it then you can open a service ticket from the
sharepoint portal and post your ticket number here and I will try to reach you as soon as I can to take care of the issue from there. If you find this information useful, then propose this as an answer and vote. Thanks. -
Is it possible to give link of document library in sharepoint list in 2010
Hi All,
Using share point list data we have shown in reports. For this we create 1 view and shown as reports. we have 1 document library with title field, same field is in list also.when we click on link on list - it redirects to library folder.
Is their anyway to do that where as list is custom list.
Any help is appreciated..!Hi Bangara,
According to your description, my understanding is that you want to create a link in your list, then this link is linked to a library folder. Is it right?
You can create a Hyperlink field in your list as opening your list->clicking on ‘Create Column’ under List ribbon, then type a name for the column, select the type of the column is Hyperlink or Picture, and Format URL is :Hyperlink.
After that, when you create a new item or edit an item in the list, you can type the URL of the related library folder in this link field.
I hope this helps.
Thanks,
Wendy
Wendy Li
TechNet Community Support -
Document Library Web Part - link to DispForm.aspx
Hi there. I'm trying to solve a problem that appeared when I tried to create a simple page with the list of documents from my document library. I need Title field displayed as a hyperlink to DispForm.aspx, not to Document itself, and not to a dropdown menu with Edit option.
The reason of this requirement is that we don't like to allow users to download document w/o reading metadata assosiated with it. On the other hand, ordinary user must not see Edit links in menu, because we don't want to tempt them to try edit document at all.
Of course, I can customize the data view in Sharepoint Designer - go to Code View and manually change <xsl:value-of select="@FileRef"/> to something like ..../dispform.aspx?ID=<xsl:value-of select="@ID"/>. But this ways seems to mee a bit ugly and I don't like to repeat this for each and other document library.
Is there any elegant way to solve the problem?
Thanks.If you are working in MOSS 2007 then a more elegant way would be to create your custom document library definition.
You need to go to the 12 hive --> features --> document library list definition.
Create a copy of this list definition and modify it so that the document name points to the dispform.aspx.
Install and activate the new feature and create document libraries using your new template.
And the other part of not showing the edit item options can be achieved using sharepoint permissions. Why create something custom for that?
Regards, Huzefa Mala, MCTS -
How to give link to SharePoint 2013 document library column to open its form?
Hi All,
I have Infopath document library form, now i want to give link to a specific column to its own item. How to achieve this? Thanks in advance!Hi Sam,
To make the custom field to act as the Name field in the list view, I recommend to use JSLINK to achieve what you want.
Below is the code example for the js file:
(function () {
var overrideCtx = {};
overrideCtx.Templates = {};
overrideCtx.Templates.Fields = {
'Services': { 'View' : CustomLink }
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(overrideCtx);
function CustomLink(ctx){
var link = ctx.CurrentItem["FileLeafRef"];
var value =ctx.CurrentItem["Services"]
var html="";
if(value!="")
{var html= "<a href='"+link+"'>"+value+"</a>";}
return html;
After writing the js file, you need to upload the file to SharePoint and then refer to it in the list view web part.
http://www.learningsharepoint.com/2012/08/03/sharepoint-2013-using-js-link-to-add-javascript-to-listviewdataview-webpart/
Best regards.
Thanks
Victoria Xia
TechNet Community Support -
How to create a 'Link to a Document' Item in a SharePoint Document Library using power shell?
Hi,
I have a document library with "Link to a document" content type. And, I have to add some links into that library using powershell. I have searched enough regarding approachs for adding a link into the library in powershell but i did not get anything yet.
Please provide some approaches and code samples to solve this problem.
Thanks,
Lalit Kumar MishraAdding Site Columns To Content Types Using PowerShell
Adding Site Columns To Content Types Using PowerShell
The below PowerShell script will allow you to add a metadata field that is either contained at the Site Collection level, Site level, or library level, to the specified Content Type.
It also contains some optional lines that you might choose to include or exclude, such as
Setting the visibility of the column in the edit form to hidden
Setting the status of the column to require values
01
function Add-SPContentTypeField
02
03
<#
04
.Synopsis
05
This function will allow you to add a library field to a Content
Type
06
.Description
07
This function will add the nominated site column/ library column to a nominated Content
Type within all of the 'Document Libraries'
in the given Site Collection
08
.Example
09
C:\PS>Add-SPContentTypeField
–SiteUrl “http://yourdomain.com/sites/Finance –FieldName
"myField" -CTypeAddedTo "myContentType"
10
.Notes
11
Name: Add-SPContentTypeField
12
Author: Petro Margaritis
13
Last Edit: 19/07/2012
14
Keywords: Fields, Site Columns, Content Types
15
.Link
16
http://thesharepointproject.com/
17
#>
18
19
Param (
20
[parameter(Mandatory=$true)][string]$SiteUrl,
21
[parameter(Mandatory=$true)][string]$FieldName,
22
[parameter(Mandatory=$true)][string]$CTypeAddedTo
23
24
25
$site = Get-SPSite
$SiteUrl
26
27
# Walk through each site in the site collection
28
$site | Get-SPWeb
-Limit all | ForEach-Object {
29
30
write-host
"Checking site:"$_.Title -Foregroundcolor
Green
31
32
# Go through each document library in the site
33
foreach
($list in $_.Lists | where
{ $_.BaseTemplate -eq "DocumentLibrary" })
34
35
36
# Check to see if the library contains the content type we are looking for
37
if (($list.ContentTypes |
where { $_.Name -eq $CTypeAddedTo
}) -eq $null)
38
39
Write-Host
"The Content:" $CTypeAddedTo "does not exist in the library:"
$list.Title -Foregroundcolor Red
40
41
else
42
43
# Check to see if the library contains the field we are looking for
44
if (($list.Fields |
where { $_.Title -eq $FieldName
}) -ne $null)
45
46
# Get the content type you want to add the field to
47
$ct
= $list.ContentTypes[$CTypeAddedTo]
48
# Get the column you want to copy
49
$field
= $list.Fields[$FieldName]
50
# Add the column to the content type
51
$ct.Fieldlinks.Add($field)
52
$ct.update()
53
54
# Add additional column settings
55
$ctFieldLinks
= $ct.FieldLinks | Where
{$_.Name -eq $field.Title}
56
# OPTIONAL: This will set the column to hidden so that it is not viewable in the edit form
57
$ctFieldLinks.Hidden =
$true
58
# Set Field to require value
59
$ctFieldLinks.Required =
$true
60
$ct.Update()
61
Write-Host
"The Field:" $field.Title "has been successfully added to the library:"
$list.Title -Foregroundcolor Cyan
62
63
else
64
65
Write-Host
"The Field:" $FieldName "does not exist in the library:"
$list.Title -Foregroundcolor Yellow
66
67
68
69
70
# Dispose of the site object
71
$site.Dispose()
72
Simply copy and paste the above into Notepad and save it as a PowerShell file with the name
Add-SPContentTypeField.ps1
view sourceprint?
1
# To run the above function you'll need to do the following - go into the saved location
2
Cd C:\scripts\
3
# Then call it using the dot prefix - note that there is a space between the dots, ..\
4
. .\Add-SPContentTypeField.ps1
5
# Now we can happily run the script like so
6
Add-SPContentTypeField –SiteUrl “http://yourdomain.com/sites/Finance –FieldName
"myField" -CTypeAddedTo "myContentType" -
How to open links from document library in a new window?
I have a column called "Links" in document library, i want to open those links in a new window. Please guide me on this how to achieve this.
Thanks
Ramanjulu Naidu Nhi,
See whether these links help you -
http://preachingsharepoint.blogspot.com/2012/06/open-document-in-new-window-from.html
http://stackoverflow.com/questions/5119919/sharepoint-links-how-to-open-in-new-tab-window
http://www.benramey.com/2011/04/25/opening-all-sharepoint-2010-documents-in-a-new-window/
http://social.technet.microsoft.com/Forums/sharepoint/en-US/9db08c4a-b53c-419a-84f8-001c194d1311/how-to-open-sharepoint-document-library-pdf-file-in-new-window?forum=sharepointadminlegacy
http://www.andrewconnell.com/Adding-OpenInNewWindow-option-to-SharePoint-Links-lists
http://www.uccorner.com/32/sharepoint/sharepoint-open-links-in-new-window/
Hope this helps!
MCITP: SharePoint 2010 Administrator
MCTS - MOSS 2007 Configuring, .NET 2.0
| SharePoint Architect | Evangelist |
http://www.sharepointdeveloper.in/
http://ramakrishnaraja.blogspot.com/ -
Hi,
am trying to create link of a document in a different library (in different site collection) using SharePoint Link a document Content type approach. i have already tested this manually.
As per my requirement i need to implement this approach through code.
If anyone has implemented link a document approach through code, please share your inputs.
help is highly appreciated!
thanksCheck if below helps:
http://blogs.msdn.com/b/cliffgreen/archive/2008/06/23/creating-a-link-to-a-document-item-in-a-sharepoint-document-library-programmatically.aspx
http://stackoverflow.com/questions/15625448/create-a-link-to-a-document-in-a-sharepoint-shared-document-list-using-powersh -
Link Document Library Add Button to home page
Let me know if it is possible to link the document library add button to homepage or any other page, if possible add a new icon to it, as part of customization.
I am using sharepoint 2013.
If possible please let me know the steps, as well as few articles related to the above would be helpful.
ThanksAs you are not displaying your new item form into a dialog you can remove the IsDlg=1 from your link and you can append a &Source="PageWhereYouWantToGoBackAfterUpload".
<a href="/sites/Contracts/_layouts/15/Upload.aspx?List=%7b89225CDC-B61A-45FC-8DC3-AC7DD97578CA%7d&RootFolder=&Source=http://www.yourSite.com"> Upload a doc</a>
Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply. -
Document Library saving link instead of the whole file
Hi,
I was just playing around with the document library v0.92 for application express. The application stores the whole information of the doc inside the database.
If I wanted to just save the name of the file and the link of the file in the database, and the actually file is stored in windows file directory, how would i do that?
Was playing around with the application builder but not quite sure how I can do it.
thanks in advance.Hi,
the file you want to access must be reachable from the database or from the application server.
A file stored somewhere on c:\user_directory\... will not be accessible by either of them.
Regards,
Daniel -
What is the formula to get document link in calculated column for document library ?
Hello,
would you please let me know the formula to get document link in calculated column ?
Thanks and Regards,
Dipti
Dipti Chhatrapatihi Dipti,
there is no column which contains the ItemURL.
if you want a colum to have url than you need to create a workflow
which calculate the ItemUrl and store it in custom column
use the below article to do this
http://www.sharepointusecases.com/2013/05/how-to-show-file-path-inside-a-sharepoint-document-library-view/
Whenever you see a reply and if you think is helpful,Vote As Helpful! And whenever you see a reply being an answer to the question of the thread, click Mark As Answer -
How to enable more documents link in Document library view on webpart page
hi,
I had document library having more then 100 items, I limited the items to display as 5. I added this document library to my web part page. Now i wan to include "More Documents..." link here but I was unable to find any such option in
web part properties.. Can any one suggest on this. How to enable this option.
Thanks & Regards, KrishnaHi Krishna,
You can add the following code in the content query template in the ItemStyle.xsl:
<xsl:if test="count(following-sibling::*)=0">
<div class="readMore" style="float:right">
<p>
<a title="More" href="/Lists/Team%20Caledar/calendar.aspx">More</a></p></div>
<xsl:if test="$ItemsHaveStreams = 'True'">
<xsl:attribute name="onclick">
<xsl:value-of select="@OnClickForWebRendering"/>
</xsl:attribute>
</xsl:if>
Thanks!
Maybe you are looking for
-
Should I be able to drag folders from a stack in list mode?
I'm unfamiliar with Lion and especially with stacks. Should I be able to drag doc. folders from a stack if it is in list mode? I can't seem to drag anything from the stack. The "About Stacks" help article seems to say that drag and drop should work i
-
Hello all, The restart of LiveCache is works fine, but I checked the LCTRC#init.log file and I saw the following error: Installation successfully finished ================================== 11455 2009-01-13 16:21:03.000 ERROR: Could not write to 'teo
-
After ALV Report i need to display the text below that
Hi Experts, I need a help. I want to display a write statment after alv report is generated.pls help me. Please Urgent.
-
B2B Add on - Party configuration using B2B - AS2 Aadapter
Can anyone help me to configure Party using B2B AS2 Adapter . I tried configuring the channel using Party passing the Sender ID . Getting this error. Cannot get channel binding: com.sap.aii.af.service.cpa.CPAObjectNotFoundException: Couldn't retriev
-
Touch screen display unreadable photosmart 6520
My touch screen is unreadable. I think something fell on it. Can't find a crack but is unreadable and I want to copy something. Printing from the computer is working.