Sunday, April 3, 2011

Removing contents of PlaceHolderPageTitleInTitleArea

Hi,

In sharepoint there is a content place holder called PlaceHolderPageTitlteInTitleArea. I'm trying to remove everything in it from a custom RenderingTemplate that I placed in CONTROLTEMPLATES. So is it possible to achieve this either by using inline code or some other ways.

Right now I've fixed it with this code in my SharePoint:RenderingTemplate control

   <script type="text/javascript">
        var tableArea = document.getElementById('onetidPageTitleAreaFrame');
        if (tableArea != null) {
            tableArea.style.height = '25px';
        }

        var titleArea = document.getElementById('onetidPageTitle');
        if (titleArea != null) {
            titleArea.style.display = 'none';
        }
    </script>
From stackoverflow
  • If you create a Custom Master Page and modify the

    <asp:ContentPlaceHolder id="PlaceHolderPageTitleInTitleArea" runat="server" />
    

    tag to read

    <asp:ContentPlaceHolder id="PlaceHolderPageTitleInTitleArea" runat="server" Visible="false" />
    

    instead, you can achieve the same result. You can create a Custom Master page by opening the site using SharePoint Designer, creating the new Master Page, copying the contents of Default.master into it, then modifying the placeholder tag, and setting that new Master page as the Custom Master page.

    You can also create a Panel control, set its visibility to false, and drop in all the placeholders which you would not want to be rendered on screen:

    <asp:Panel visible="false" runat="server">
     <asp:ContentPlaceHolder id="PlaceHolderPageTitleInTitleArea" runat="server" />
    </asp:Panel>
    

    Hope this helps.

0 comments:

Post a Comment