Tuesday, June 3, 2014

SharePoint: Call new document content type popup page of a document library on button click.

Context: Customer wants to have a button on the home which will be used to open the new document. If the customer wants to create a new document or a document set, he has to navigate to the document library and later clicking the documents tab and selecting a new Document option. In our scenario, the document library consist of documents sets and a document set consist of a content type.

Solution: The solution is based on the content editor webpart. The webpart refers to the html page from the SiteAssets document library. In order to get the Url of the popup new document page, go to the document library settings -> Advance settings-> Launch forms in Dialog (No). After these settings, click again the new document and you can get the url of the popup page. Use that url in your code for invoking the default popup page. Also do remember to revert the settings to Launch forms in Dialog (Yes), once u get the url.

After getting the url, the following code I wrote in a html file to call new document popup;




 
  
        
        
 
 
 
 

Later I deployed the html file in the Asset library. Once I had the html file, I added a content editor webpart on the Welcome page of the site and referred the html file..Thats it..Happy coding..J

No comments:

Post a Comment