Question

I would like to display a customized message on top of the "New Site" dialog window, however since it is Silverlight I'm not sure if this is even possible.

I've thought of using javascript to highjack the "New Site" click event from the "Site Actions" menu before the dialog is displayed and show the message here. Then when the user clicks OK open the dialog with the Silverlight control and proceed as normal. But this seems like quite a hack and possibly not worth investigating further. Also it will not work if you create the web through "Manage Site Structure".

Is there an easier way to do this? Like a mechanism in SharePoint similar to how you add custom actions to the site actions menu? The message does not have to be a popup, just some way of displaying custom text as the user tries to create a new web.

Was it helpful?

Solution

I think less "painful" approach for you is modifying v4 masterpage. It contains SharePoint:SiteActions control with SharePoint:MenuItemTemplate runat="server" id="MenuItem_CreateSite".

You can update code in ClientOnClickScriptContainingPrefixedUrl to perform your logic, for example showing confirmation message like I do it:

<SharePoint:MenuItemTemplate runat="server" id="MenuItem_CreateSite"
    Text="<%$Resources:wss,siteactions_createsite%>"
    Description="<%$Resources:wss,siteactions_createsitedesc%>"
    ImageUrl="/_layouts/images/newweb32.png"
    MenuGroupId="200"
    Sequence="230"
    UseShortId="true"
    ClientOnClickScriptContainingPrefixedUrl="if (confirm('Are you sure?')) { SP.UI.ModalDialog.showModalDialog({url:'~site/_layouts/AddGallery.aspx', title: 'Create', width: 1050, height: 600}); }"
    PermissionsString="ManageSubwebs,ViewFormPages"
    PermissionMode="All" />

OTHER TIPS

Not as far as I know. As you rightly commented, this is a Silverlight component. Silverlight components are wrapped in Cab files and you dont have any way of changing it. Also, you can't hack it if you wanted using Javascript. JS and Silverlight are two totally different components. JS is used to modify DOM elements. Silverlight is an Object in the DOM, but uses a client plugin which you have no control over. If you really wanted to , i'd suggest you create your own Silverlight Component which mimics the existing Silverlight window for creating sites/lists/pages and hook it up to the Site Actions > More Options link.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top