2

I have a new Document Library and have added the content type "link to a document" to the library. Somehow when I create a new "link to a document" item in the library the dialog won't open. Instead I'll be redirected to NewLink.aspx. The other content types open in a dialog without exeption.

I'm using the new button in the ribbon.

Has anyone ever tried to change this behavior using code so that the newlink.aspx will open in a modal dialog ?

Any hints on this?

The "Launch forms in a dialog (Check yes)" won't work because this behavior only happens for certain content types.

2 Answers 2

3

Go to document library settings > Advanced Settings >
Launch forms in a dialog (Check yes) and Save.

It should work.

7
  • Thanx but no. This only happens to certain content types. Jun 2, 2012 at 9:47
  • Please mention the site template for the site where your document library is located. And secondly is this a SharePoint generated document library or a custom created one ?
    – ArkoD
    Jun 2, 2012 at 10:12
  • 3
    Stefan - since your question did not mention specifically if your are using any custom content types so I asked you concerning the content types because I tried the same with a out of the box library and it worked just fine before I replied. --- Now we are all here to collaborate and learn. And I do care about what I reply and validate before sharing something.
    – ArkoD
    Jun 2, 2012 at 14:37
  • 3
    My answers have been responsible so far in this forum and would request you to extend the basic courtesy to people who are trying to answer or solve your problem. Forgive me if the answer you seek is not correct from my side but the tone of your comment is just not something commendable on a technical forum like this. Thanks.
    – ArkoD
    Jun 2, 2012 at 14:41
  • 1
    Guys, I think this is more to do with language. The original question was perhaps not crystal clear and Moss was doing his best to understand and help. Stefan, I think your comment comes across as rather rude and I suspect that this was not your intention. Let's keep it polite, bear in mind that english is not everyone's first language, and try to help each other. Thanks. [moderator]
    – SPDoctor
    Jun 3, 2012 at 17:44
1

You can use JavaScript to do this.

"<a onclick='javascript:SP.UI.ModalDialog.showModalDialog({ url: "
               + string.Format("\"{0}?ID={1}\", title: \"{2}\"", listName, itemID, item.Title)
               + " }); return false;' href=''>"
               + item.Title
               + "</a>";

This code gets JavaScript to create a dialog (provided the setting that Moss mentions is enabled).

Further reading can be found here: http://blogs.msdn.com/b/sharepointdev/archive/2011/06/23/how-to-open-a-list-form-in-a-modal-dialog-box.aspx

1
  • Do you use the new link from the ribbon? The problem is only certains dialogs won't open in a modal dialog from the ribbon new button. Aug 3, 2012 at 15:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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