locked
Is it possible to create a custom form for a custom web template RRS feed

  • Question

  • Hi there!

    I wonder if it's possible to customize the form that are used when creating a site/web. Can I override or add fields in some way to it that I can then later consume like in WebAdding/WebProvisioned?

     

    Regards

    Robert

     

    Monday, June 27, 2011 12:08 PM

Answers

  • The AddGallaery.ASPX page is JavaScript and SilverLight based.  If you want to tie into the actual code running there, you would need to write your own silverlight control, or remove the silverlight stuff from the page and make it a normal page with postbacks etc.

     

    There is a delegate control on that page called the SiteMapDataSource delegate control, and another called the QuickLaunchDataSource. 

     

    But the actual body of the pate is a silverlightControlHost container which is spinning up the AddGallery.xap silverlight application.

     

    In theory you could remove all the silverlight controls and replace it with a standard webpart that does the same thing then add w/e you want to it.  But that would affect the whole farm.  So what you could do, is make it a new page called AddGalleryCustom.aspx.  Then create an HTTPModule that redirects AddGallery.aspx to AddGalleryCustom.aspx on a per web application basis.

     

    Long story short, there is no way to do what you want to do by design, so you'd have to use work arounds and //hack's (aka bad code) to do it.

    Another thing you can do is pre render control swapping.

    You hookinto a delegate control to get your control loaded on the page.  Then in your controls CreateChildControls event, After calling base.CreateChildControls, you do something like

    Control p = this.Parent;

    for (int i = 0; i < p.Controls.Count;++i)

    {

        //find the index of where you want to remove existing control, or add your controls.

    }

    //remove controls AtIndex, and insert your controls At Index.

    //Dirty code.

     

    The issue in this case though, is that the control you want to add functionality to is a Silverlight App, so I don't think it's possible without removing and replacing all the silverlight and javascript components on the page.


    My Blog: http://www.thesug.org/Blogs/ryan_mann1/default.aspx Website: Under Construction
    • Marked as answer by skyttberg Wednesday, June 29, 2011 7:29 PM
    Tuesday, June 28, 2011 2:04 PM

All replies

  • You could create your own version of /_layouts/addgallery.aspx

    What kind of properties would would you like to enter?

    Tuesday, June 28, 2011 11:44 AM
  • The AddGallaery.ASPX page is JavaScript and SilverLight based.  If you want to tie into the actual code running there, you would need to write your own silverlight control, or remove the silverlight stuff from the page and make it a normal page with postbacks etc.

     

    There is a delegate control on that page called the SiteMapDataSource delegate control, and another called the QuickLaunchDataSource. 

     

    But the actual body of the pate is a silverlightControlHost container which is spinning up the AddGallery.xap silverlight application.

     

    In theory you could remove all the silverlight controls and replace it with a standard webpart that does the same thing then add w/e you want to it.  But that would affect the whole farm.  So what you could do, is make it a new page called AddGalleryCustom.aspx.  Then create an HTTPModule that redirects AddGallery.aspx to AddGalleryCustom.aspx on a per web application basis.

     

    Long story short, there is no way to do what you want to do by design, so you'd have to use work arounds and //hack's (aka bad code) to do it.

    Another thing you can do is pre render control swapping.

    You hookinto a delegate control to get your control loaded on the page.  Then in your controls CreateChildControls event, After calling base.CreateChildControls, you do something like

    Control p = this.Parent;

    for (int i = 0; i < p.Controls.Count;++i)

    {

        //find the index of where you want to remove existing control, or add your controls.

    }

    //remove controls AtIndex, and insert your controls At Index.

    //Dirty code.

     

    The issue in this case though, is that the control you want to add functionality to is a Silverlight App, so I don't think it's possible without removing and replacing all the silverlight and javascript components on the page.


    My Blog: http://www.thesug.org/Blogs/ryan_mann1/default.aspx Website: Under Construction
    • Marked as answer by skyttberg Wednesday, June 29, 2011 7:29 PM
    Tuesday, June 28, 2011 2:04 PM