You know what’s not so easy in Sp2013? Newform.aspx urls. Sure they live in the document library ribbon.
Sure you can also just drag stuff in, but what if you want to create a custom page and make it even easier for your users to create a new document?
That’s not so easy. So i set about figuring out the best way to do this.
So I scoured the interwebs for some code. I came across this Gem by Ahmed Farag:
Thanks Ahmed you got me started!
This is an elegant solution if your library is out of the box. But what if you have custom content types?
That is not so easy to figure out. Once i did figure it out it was easy but not at first. You see, if you add a custom content type to a document library, the content type lives in _layouts, not in list/library name.
So how do you link that?
Well my friends, I am glad you asked.
First things first, like Ahmed says, grab yourself a content editor webpart (not script editor, that one has issues) and add it to a page.
Open your fav notepad editor
Copy Mr. Farag’s elegant code into it and click save.
Display Item </a>As you will figure out, content types do not live in /list/, they live in _layouts. So, how do i get that darn URL? Its actually stupid simple. Basically, all you have to do navigate to your library settings, advanced settings, and find the open forms in dialogue, and click no. Go back to your library and click new document and select your custom content type.
That will open your new item in a page, where, gasp, you can copy the url and past it into Ahmed code.
</a> That's it. Now you have a new button that creates your new content type.
Tips: Make sure when you use content editor you upload your code to the asset library and link the file inside the content editor, so you can edit it easier.
TIP: Turn on versioning in your asset library so you can version your code out.
You are welcome world!