SharePoint O365 Default Content Type Template Loads Automatically
-
25-12-2020 - |
Question
I am working with a Form library, that also has a requirement for users to create Word and Excel files. The library has been configured to allow for multiple content types, however, upon clicking +New, the default content type automatically loads. Users can briefly see the list of available content types, but are unable to select one.
I have seen this question ask in the past, but no correct answer was ever given. I am hoping that someone has been able to figure this out.
Thank you.
Solution
I found a workaround. I really don't care if it's not "elegant": I just need it to work -which it does!
How I did it:
Ensure the custom content types are enabled in the list
If you want to still include the Upload button, right click on it, chose Inspect element, copy the code for the button, then paste it into Notepad for later use
Do the same for the +New button
Click the FILES tab --> New Document dropdown, and open one of your custom content types custom content types
Once the template loads, copy the URL
Go back to Notepad, and in the button code, replace "Renderer.FunctionDispatcher.Execute(this,0,"itemClick",event,Renderer.FunctionDispatcher.GetObject(0))" -found in the onclick event- with the URL to the template that you just copied
Repeat steps 4-6 for each additional custom content type
Insert a CEWP, and hide the +New dropdown with CSS .ms-list-addnew-aligntop.ms-list-addnew {padding-bottom:0;} table#Hero-WPQ2 {display:none;} .ms-csrlistview-controldiv {padding-left:15px;}
List item
Insert another CEWP directly above the list
In the CEWP, copy/paste the code for the button(s) you created in step 6
Copy/paste the code for the Upload button, from step 2