locked
Is it possible to Hide SharePoint Out Of the Box Default WebPart Template? RRS feed

  • Question

  • I have a requirement from my client. I need to hide a out of the box default WebPart page Template using PowerShell Script or Programatically in all site Collections and their subsites. if possible while creation of site itself.

    We are using SharePoint 2010.

    Its really urgent. Thanks for help in advance.

    Let me know if you have any questions.

    Monday, April 7, 2014 7:24 PM

Answers

All replies

  • Hi,

    It is not recommended to modify this page because it is used farm widely.

    What’s more, it will be overwritten once there is upgrade happens.

    A workaround is that you can create a custom spcf.aspx page with the layout templates you want.

    http://doitwithsharepoint.blogspot.com/2011/08/create-web-part-pages-with-custom.html

    http://sandeeppawar.blogspot.com/2012/06/create-custom-web-part-page-template.html

    If you want to hide a layout template by modifying the spcf.aspx page, it locates at

    C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS

    You can edit this page and remove some <option> tags in the <select> tag, then the removed options will not display on the page.

     

    Thanks

    Patrick Liang

    Forum Support

    Please remember to mark the replies as answers if they
    help and unmark them if they provide no help. If you have feedback for TechNet
    Subscriber Support, contact
    tnmff@microsoft.com



    Patrick Liang
    TechNet Community Support

    Tuesday, April 8, 2014 8:35 AM
  • Thanks you for the response Patrick as per your suggestion i was looking in spcf.aspx.

    I am planning to comment the below given section in spcf.aspx to check whether it will hide default webpart template.

    <Template_Control> <select id="onetidWebPartPageTemplate" name="WebPartPageTemplate" size="8" onchange="DoTemplateOptionChange()"> <option value="2" selected="true"><SharePoint:EncodedLiteral runat="server" text="<%$Resources:wss,webpagecreation_layout_option2%>" EncodeMethod='HtmlEncode'/></option> <option value="1"><SharePoint:EncodedLiteral runat="server" text="<%$Resources:wss,webpagecreation_layout_option1%>" EncodeMethod='HtmlEncode'/></option> <option value="3"><SharePoint:EncodedLiteral runat="server" text="<%$Resources:wss,webpagecreation_layout_option3%>" EncodeMethod='HtmlEncode'/></option> <option value="4"><SharePoint:EncodedLiteral runat="server" text="<%$Resources:wss,webpagecreation_layout_option4%>" EncodeMethod='HtmlEncode'/></option> <option value="5"><SharePoint:EncodedLiteral runat="server" text="<%$Resources:wss,webpagecreation_layout_option5%>" EncodeMethod='HtmlEncode'/></option> <option value="6"><SharePoint:EncodedLiteral runat="server" text="<%$Resources:wss,webpagecreation_layout_option6%>" EncodeMethod='HtmlEncode'/></option> <option value="7"><SharePoint:EncodedLiteral runat="server" text="<%$Resources:wss,webpagecreation_layout_option7%>" EncodeMethod='HtmlEncode'/></option> <option value="8"><SharePoint:EncodedLiteral runat="server" text="<%$Resources:wss,webpagecreation_layout_option8%>" EncodeMethod='HtmlEncode'/></option> </select> </Template_Control>

    I would appreciate if you can tell me the impacts it will just hide or screw up the SharePoint farm. Once again thanks for your help.

    • Edited by Tech-Fun Tuesday, April 8, 2014 7:16 PM formating
    Tuesday, April 8, 2014 7:15 PM
  • Hi,

    If you comment some options above in spcf.aspx, those options will stay hidden until there is restore or upgrade.

    As the modification only happens on this page, it will not screw up the whole farm.

    What's more, it would be better to make a copy before you modify that page.

    Best regards


    Patrick Liang
    TechNet Community Support

    Wednesday, April 9, 2014 1:15 AM
  • Thanks for reply. I will check.
    Thursday, April 10, 2014 1:38 AM