Answered by:
Open Discussion Thread in Modal Dialog

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!
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:
- Launch SharePoint Designer and open the site with the discussion board.
- In Navigation pane click All Files. (If this is not displayed your administrators may have partially locked down Designer.)
- Click Lists
- Click your discussion list
- Click Allitems.aspx
- In the Ribbon click Advanced Mode
- find the following lines:
</ZoneTemplate></WebPartPages:WebPartZone>
</asp:Content> - In between these two lines insert a blank line and paste the JavaScript below.
- 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
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:
- Launch SharePoint Designer and open the site with the discussion board.
- In Navigation pane click All Files. (If this is not displayed your administrators may have partially locked down Designer.)
- Click Lists
- Click your discussion list
- Click Allitems.aspx
- In the Ribbon click Advanced Mode
- find the following lines:
</ZoneTemplate></WebPartPages:WebPartZone>
</asp:Content> - In between these two lines insert a blank line and paste the JavaScript below.
- 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
-