none
Open Discussion Thread in Modal Dialog RRS feed

  • Question

  • Hi again,

    I am wondering if it possible to have SharePoint open a discussion thread in a modal dialog. To be clear, this happens when someone adds a new discussion thread (ie. creates a new one). However, when clicking on an existing one to provide a comment, this opens in a new page rather than in a modal dialog. I would prefer the modal approach as the user then doesn't leave the page when submitting a reply to a thread.

    Is this possible?

    thanks!

    Friday, February 27, 2015 7:29 PM

Answers

  • I have a solution, but

    • This will require the use of SharePoint Designer.
    • It has not been heavily tested, and only tested in SP 2010.
    • The reply counts will not be automatically updated in the base discussion page.
    • The page will be "unghosted" (customized) and might not upgrade correctly to the next version of SharePoint.
    • Use at your own risk, batteries not included.

    Steps:

    1. Launch SharePoint Designer and open the site with the discussion board.
    2. In Navigation pane click All Files. (If this is not displayed your administrators may have partially locked down Designer.) 
    3. Click Lists
    4. Click your discussion list
    5. Click Allitems.aspx
    6. In the Ribbon click Advanced Mode
    7. find the following lines:
      </ZoneTemplate></WebPartPages:WebPartZone>
      </asp:Content>
    8. In between these two lines insert a blank line and paste the JavaScript below.
    9. Save your changes, return to the discussion list and test.

    <script>
    	function ttnGoToDiscussion(url)
    	{
    		var options = SP.UI.$create_DialogOptions();
    		options.url = url;
    		options.width = 800;
    		options.height = 500;
    		SP.UI.ModalDialog.showModalDialog(options);		
    	} 
    	
    	function ChangeHowDiscussionsOpen()
    	{
    		GoToDiscussion = ttnGoToDiscussion;
    	}
    	
    	ChangeHowDiscussionsOpen()
    </script>
    


    Mike Smith TechTrainingNotes.blogspot.com
    Books: SharePoint 2007 2010 Customization for the Site Owner, SharePoint 2010 Security for the Site Owner

    • Marked as answer by Franco667 Wednesday, March 4, 2015 7:55 PM
    Saturday, February 28, 2015 12:27 AM

All replies

  • I have a solution, but

    • This will require the use of SharePoint Designer.
    • It has not been heavily tested, and only tested in SP 2010.
    • The reply counts will not be automatically updated in the base discussion page.
    • The page will be "unghosted" (customized) and might not upgrade correctly to the next version of SharePoint.
    • Use at your own risk, batteries not included.

    Steps:

    1. Launch SharePoint Designer and open the site with the discussion board.
    2. In Navigation pane click All Files. (If this is not displayed your administrators may have partially locked down Designer.) 
    3. Click Lists
    4. Click your discussion list
    5. Click Allitems.aspx
    6. In the Ribbon click Advanced Mode
    7. find the following lines:
      </ZoneTemplate></WebPartPages:WebPartZone>
      </asp:Content>
    8. In between these two lines insert a blank line and paste the JavaScript below.
    9. Save your changes, return to the discussion list and test.

    <script>
    	function ttnGoToDiscussion(url)
    	{
    		var options = SP.UI.$create_DialogOptions();
    		options.url = url;
    		options.width = 800;
    		options.height = 500;
    		SP.UI.ModalDialog.showModalDialog(options);		
    	} 
    	
    	function ChangeHowDiscussionsOpen()
    	{
    		GoToDiscussion = ttnGoToDiscussion;
    	}
    	
    	ChangeHowDiscussionsOpen()
    </script>
    


    Mike Smith TechTrainingNotes.blogspot.com
    Books: SharePoint 2007 2010 Customization for the Site Owner, SharePoint 2010 Security for the Site Owner

    • Marked as answer by Franco667 Wednesday, March 4, 2015 7:55 PM
    Saturday, February 28, 2015 12:27 AM
  • Mike this works!!! Even in a CEWP!

    You are the modal king! :)


    • Edited by Franco667 Wednesday, March 4, 2015 7:56 PM
    Wednesday, March 4, 2015 7:56 PM