Wednesday, January 19, 2011

SharePoint 2010 Modal Dialog Window / Popup & XSLT Examples

Just wanted to share some of my XSLT snippets to create SharePoint 2010 modal dialog window / popups.

You can find some great info on Modal Windows here:
http://erikswenson.blogspot.com/

Also check out PAGETYPE Enumeration:
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.pagetype.aspx


Here is a basic example of how to launch the Modal Window:

Show Bing In Modal Window



Now, some XSLT snippets for a discussion list view / toolbar

// New Form for Discussions

javascript:NewItem2(event,'../_layouts/listform.aspx?PageType=8&ListID={}&RootFolder=&ContentTypeId=0x0107&DiscussionParentId=');javascript:return false;

../_layouts/listform.aspx?PageType=8&ListID={}&RootFolder=&ContentTypeId=0x0107&DiscussionParentId=

Reply



// Edit Form

javascript:NewItem2(event,'../_layouts/listform.aspx?PageType=6&ListId={}&ID=');javascript:return false;

../_layouts/listform.aspx?PageType=6&ListId={}&ID=

Edit



// Display form to view attachments


javascript:NewItem2(event,'../_layouts/listform.aspx?PageType=4&ListId={}&ID=');javascript:return false;

../_layouts/listform.aspx?PageType=4&ListId={}&ID=

_self

View Attachments

Attachment(s)




More useful links: SharePoint Developer Team Blog: How to Open a List Form in a Modal Dialog Box