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

I have a fairly simple SharePoint subsite that has two elements:

  • the home page
  • a document library

The document library has two content types associated with it. What I would like to do is add a link (or button, whatever) to the home page that creates a new document based on the content type.

Essentially, I want to replicate the behavior of:

  1. Navigating to the library
  2. Clicking the Documents tab
  3. Selecting one of the content types from the New Document icon

All from the subsite's home page. Is this possible?


EDIT: I finally got a chance to look at this. Sorry for the huge delay.

So, I created the new form (test.aspx) and inserted the following script and link(s) in the page:

<script type="text/javascript">
function generalInformation() {
     var options = SP.UI.$create_DialogOptions();
     options.title = "New General Information Bulletin";
     options.autoSize = true;
     options.url = "Bulletins/Forms/test.aspx";    
     SP.UI.ModalDialog.showModalDialog(options); }
 </script>

<div>
<a onclick="javascript:generalInformation();">New General Information Bulletin</a>
<a href="Bulletins/Forms/test.aspx">New General Information Bulletin</a></div>

So, I have the two links just for testing purposes. Once invokes the javascript function, and does open a modal dialog. The desired behavior, however, is for Word to launch with a new document based on the template specified by the content type. I'm not sure what I've got wrong, but that is not at all the result I am getting.

Instead, the first link launches a dialog entitled "New General Information Bulletin" that has edit and page tabs, and a save, cancel, paste, cut, and copy buttons in the ribbon. It also has two Save and Cancel buttons. Neither appears to do anything.

What am I missing?

share|improve this question

4 Answers 4

Ok. This is what you do.

Fire up Sharepoint Designer and navigate to the list.

On the forms section on the right hand side , click New.

Create a new Form for New Item and select the corresponding Content Type to be used at the bottom.

Save your form and remember the Form name (Example NewDocument.aspx).

Next up, you would normally want your new document, or new item forms to appear in a modal. So, create a link such as: <a onclick="javascript:NewDocument();">New Document type 1</a> with which calls the following javascript:

var options = SP.UI.$create_DialogOptions();
    options.title = "New Document type 1";
    options.autoSize = true;
    options.url = "/Lists/YourListName/NewDocumentType1.aspx";    
    SP.UI.ModalDialog.showModalDialog(options);

Repeat the same process for your other content type.

Hope this makes sense. Let me know if you need help.

Cheers

share|improve this answer
    
Thank you -- I do not currently have permissions to use Designer for this particular site, but I think I can get an exception long enough to try this out. Will post back when I am able to test. –  Chad Dybdahl Dec 19 '12 at 14:31
    
Ok, I finally got a chance to test. –  Chad Dybdahl Jan 31 '13 at 16:39

Yes, the content type links in the library go to specific URLs. Grab those and then create some simple HTML on your home page and point hyperlinks or buttons to those URLs.

share|improve this answer
    
Thank you -- I did try to locate the URL but there was no option to "Copy Shortcut" when right-clicking on the content type menu option. I'll poke into the page code a bit more to see what I can find. –  Chad Dybdahl Dec 19 '12 at 14:33
    
There's no url on the page. Since the "new document page" gets loaded into a modal dialog, it's being called by javascript. –  Fox Dec 19 '12 at 14:35
    
That was my suspicion -- and I couldn't see a way to access the javascript from the UI. I'll try your solution, which I'm sure will work. –  Chad Dybdahl Dec 19 '12 at 14:40

I did it the following way:

  1. Go to the Library Settings / Advanced Settings and set "Launch forms in dialogs?" to No.
  2. Go back to the library and open the new document forms (for each content type). The "new forms" will now appear as main content and not in a pop up.
  3. While the New Form is open you can copy the URL for each content type`s new form.
  4. Switch back the option to launch forms in dialogs back to Yes (optional).
  5. Create links or buttons on your homepage with the copied links for each content type (these linked forms will not be launched in dialogs)
share|improve this answer
    
Thanks for your reply. I'm afraid, though, that you've lost me at step 2. There are no forms associated with these content types, and so they have no URL. When I click Documents > New Document, I just get a Word document based on the template. There is no intermediate window that appears from which I could grab a URL. –  Chad Dybdahl Jan 7 '13 at 14:21

After adding the document content type/s to a library, add the library to a web page and set its toolbar to display. From there you can grab the code for the new button/template from the page's source code and paste into a CEWP. For a library with multiple document content types, enable only one at a time and grab the code for each separately.

For step-by-step instructions view my post on creating links to document content type templates here: http://jennyssharepointtips.wordpress.com/2014/07/30/launch-document-content-type-templates-from-any-web-page-with-a-link/

share|improve this answer

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.