2

Have a document library with multiple content types, each using a template. Example, user click on 'New Document' > 'Content A' and a Excel form will open.

I'm trying to create links (buttons to be exact) so that users can just click on a button to open the appropriate form or content type. I've tried the following but have not had any success.

<a onclick="javascript:NewItem2(event, &quot;http:// devsite/_layouts/ManageContentType.aspx?PageType=8&amp;ListId={BDE9D06D-FE32-407A-8720-51B455325113}&amp;ContentTypeId=0x010100469347CCDC047640BC19F598DC9F630400F53FB9BCC4D89A419926F45A89AEDF98&amp;RootFolder=&quot;); javascript:return false;" href="/_layouts/ManageContentType.aspx?PageType=8&amp;ListId={ BDE9D06D-FE32-407A-8720-51B455325113}&amp;ContentTypeId=0x010100469347CCDC047640BC19F598DC9F630400F53FB9BCC4D89A419926F45A89AEDF98&amp;RootFolder="target="_self"> New Form</a>
  • Welcome to the SharePoint SE community, David! Can you provide a little more detail about the environment and what you're using to achieve this goal? For example, which version of SharePoint, and where are you using this script? – thanby Jan 6 '14 at 17:52
  • I'm using SharePoint 2010 Server, and am posting the above script in a CEWP on a blank page. I basically am trying to add "links" on a blank page to each of the different document templates. For example, if John needed to get "FormA", he could go to this page and click on a link for FormA. – David Jan 6 '14 at 18:33
1

I believe your link is inccorect (the actual ManageContentType.aspx application page is used to change the actual Content Type structure (as you click on an actual existent Content type via the List/Library Settings on a list having enabled management of content type).

To my understanding you are basically trying to link to Create new item based on a content type (for situations where you have multiple already linked to your list). In that case you can use

<Site Collection URL>/Lists/<YourList>/NewForm.aspx?RootFolder=<Full List Url Linking to where should the item be created>&ContentTypeId=<CONTENT TYPE ID>
  • Replace the items between tag brackets with appropriate items. To get these easier, i would also suggest go to List Settings > Advanced Settings and disable "Launch forms in dialog", having multiple Content Types per list would give you the exact address.

As for the actual web part - for better more flexible outcome results - why not using a Link list and standard XSLT View / Data View web parts to show the actual items simply?

0

Hi try switching the " with a single apostrophe '

that ought to work

  • 1
    Why should that work? The onclick and href attributes are HTML attributes and hence " should be used. – Robert Lindgren Jan 6 '14 at 19:54
  • Or are you referring to his &quot tags? There I would also use single apostrophes :) – Robert Lindgren Jan 6 '14 at 19:55
  • yes.. it's the &quot tag.. I didn't see that it changed what I wrote to an actual " :-) – Burrhus Jan 8 '14 at 7:03
0
  1. Add the document content type/s to a library.
  2. Add the library to a web page as a web part and set its toolbar to display.
  3. View the page’s source code and copy the code for the new button/template.
  4. Enter the code into a CEWP for a link to the content type.

NOTE: 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/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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