Removing various parts of a WikiPlus page by editing the page template

3 Months Ago
dean
Wiki Plus

By manipulating the WikiPlusTemplates.ascx located in C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\TEMPLATE\CONTROLTEMPLATES you are able to remove various parts of a WikiPlus page.

To remove the recent discussions section

<SharePoint:RenderingTemplate ID="ResentDiscussionsForm" runat="server">
      <Template>
            <table border="0" cellpadding="0" cellspacing="0" width="100%" id="main_ResentDiscussionsTable">
                  <tr class="ms-WPHeader">
                        <td title="Resent Discussions" style="width: 100%;">
                              <h3 class="ms-standardheader ms-WPTitle">
                                    <nobr>
                                          <span><SharePoint:FormattedString ID="FormattedString1" FormatText="<%$Resources:wikiplus,wikipage_ResentDiscussions_title%>" runat="server"/></span>
                                    </nobr>
                              </h3>
                        </td>
                  </tr>
                  <tr class="ms-WPHeader">
                        <td style="width: 100%;">
                              <KWizCom:ResentDiscussions ID="ResentDiscussions1" runat="server" FieldsList="Title;CorrectBodyToShow;MessageBody;DiscussionTitle;Modified;Editor;Attachments"
                                    RowsLimit="5">
                                    <Columns>
                                          <asp:TemplateField HeaderText="<%$Resources:wikiplus,resentDiscussions_Header_Post%>" ItemStyle-Width="60%" HeaderStyle-HorizontalAlign="Left">                            
                                                <ItemTemplate>                                                                
                                                      <%# (DataBinder.Eval(Container.DataItem, "Title", "") != "" ?  DataBinder.Eval(Container.DataItem, "Title", "") + "<br/>" : "")%>
                                                      <%# (DataBinder.Eval(Container.DataItem, "CorrectBodyToShow", "") != "" ?  DataBinder.Eval(Container.DataItem, "CorrectBodyToShow", "") : DataBinder.Eval(Container.DataItem, "MessageBody", ""))%>
                                                </ItemTemplate>
                                          </asp:TemplateField>
                                          <asp:TemplateField HeaderText="<%$Resources:wikiplus,resentDiscussions_Header_Details%>"
                                                HeaderStyle-HorizontalAlign="Left">
                                                <ItemTemplate>
                                                      <b>
                                                            <SharePoint:EncodedLiteral ID="EncodedLiteral1" runat='server' Text='<%$Resources:wikiplus,resentDiscussions_From_Title%>'
                                                                  EncodeMethod="HtmlEncode" /></b>
                                                      <%# DataBinder.Eval(Container.DataItem, "Editor", "")%><br />
                                                      <b>
                                                            <SharePoint:EncodedLiteral ID="EncodedLiteral2" runat='server' Text='<%$Resources:wikiplus,resentDiscussions_Posted_Title%>'
                                                                  EncodeMethod="HtmlEncode" /></b>
                                                      <%# DataBinder.Eval(Container.DataItem, "Modified", "{0:f}")%><br />
                                                      <b>
                                                            <SharePoint:EncodedLiteral ID="EncodedLiteralSubject" runat='server' Text='<%$Resources:wikiplus,resentDiscussions_Subject_Title%>'
                                                                  EncodeMethod="HtmlEncode" /></b>
                                                      <%# (DataBinder.Eval(Container.DataItem, "DiscussionTitle", "") != "" ?  DataBinder.Eval(Container.DataItem, "DiscussionTitle", "") : DataBinder.Eval(Container.DataItem, "Title", ""))%><br />
                                                      <asp:Repeater ID="rptrRecentDiscussionsAttachmetns" runat="server" Visible='<%# DataBinder.Eval(Container.DataItem, "Attachments", "") == "1" %>'>
                                                            <HeaderTemplate>
                                                                  <b>
                                                                        <SharePoint:EncodedLiteral ID="EncodedLiteral6" runat='server' Text='<%$Resources:wikiplus, wikiplus_resourcesection_header%>'
                                                                              EncodeMethod="HtmlEncode" />:</b>
                                                            </HeaderTemplate>
                                                            <ItemTemplate>
                                                                  <br />
                                                                  <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# DataBinder.Eval(Container.DataItem, "Value", "") %>'><%# DataBinder.Eval(Container.DataItem, "Key", "") %></asp:HyperLink>
                                                            </ItemTemplate>
                                                      </asp:Repeater>
                                                </ItemTemplate>
                                          </asp:TemplateField>
                                    </Columns>
                              </KWizCom:ResentDiscussions>
                        </td>
                  </tr>
            </table>
      </Template>
</SharePoint:RenderingTemplate>

To remove the recently modified section

<SharePoint:RenderingTemplate ID="ResentDiscussionsForm" runat="server">
<Template>
<table border="0" cellpadding="0" cellspacing="0" width="100%" id="main_ResentDiscussionsTable">
<tr class="ms-WPHeader">
<td title="Resent Discussions" style="width: 100%;">
<h3 class="ms-standardheader ms-WPTitle">
<nobr>
<span><SharePoint:FormattedString ID="FormattedString1" FormatText="<%$Resources:wikiplus,wikipage_ResentDiscussions_title%>" runat="server"/></span>
</nobr>
</h3>
</td>
</tr>
<tr class="ms-WPHeader">
<td style="width: 100%;">
<KWizCom:ResentDiscussions ID="ResentDiscussions1" runat="server" FieldsList="Title;CorrectBodyToShow;MessageBody;DiscussionTitle;Modified;Editor;Attachments"
RowsLimit="5">
<Columns>
<asp:TemplateField HeaderText="<%$Resources:wikiplus,resentDiscussions_Header_Post%>" ItemStyle-Width="60%" HeaderStyle-HorizontalAlign="Left">                            
<ItemTemplate>                                                                
<%# (DataBinder.Eval(Container.DataItem, "Title", "") != "" ?  DataBinder.Eval(Container.DataItem, "Title", "") + "<br/>" : "")%>
<%# (DataBinder.Eval(Container.DataItem, "CorrectBodyToShow", "") != "" ?  DataBinder.Eval(Container.DataItem, "CorrectBodyToShow", "") : DataBinder.Eval(Container.DataItem, "MessageBody", ""))%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="<%$Resources:wikiplus,resentDiscussions_Header_Details%>"
HeaderStyle-HorizontalAlign="Left">
<ItemTemplate>
<b>
<SharePoint:EncodedLiteral ID="EncodedLiteral1" runat='server' Text='<%$Resources:wikiplus,resentDiscussions_From_Title%>'
EncodeMethod="HtmlEncode" /></b>
<%# DataBinder.Eval(Container.DataItem, "Editor", "")%><br />
<b>
<SharePoint:EncodedLiteral ID="EncodedLiteral2" runat='server' Text='<%$Resources:wikiplus,resentDiscussions_Posted_Title%>'
EncodeMethod="HtmlEncode" /></b>
<%# DataBinder.Eval(Container.DataItem, "Modified", "{0:f}")%><br />
<b>
<SharePoint:EncodedLiteral ID="EncodedLiteralSubject" runat='server' Text='<%$Resources:wikiplus,resentDiscussions_Subject_Title%>'
EncodeMethod="HtmlEncode" /></b>
<%# (DataBinder.Eval(Container.DataItem, "DiscussionTitle", "") != "" ?  DataBinder.Eval(Container.DataItem, "DiscussionTitle", "") : DataBinder.Eval(Container.DataItem, "Title", ""))%><br />
<asp:Repeater ID="rptrRecentDiscussionsAttachmetns" runat="server" Visible='<%# DataBinder.Eval(Container.DataItem, "Attachments", "") == "1" %>'>
<HeaderTemplate>
<b>
<SharePoint:EncodedLiteral ID="EncodedLiteral6" runat='server' Text='<%$Resources:wikiplus, wikiplus_resourcesection_header%>'
EncodeMethod="HtmlEncode" />:</b>
</HeaderTemplate>
<ItemTemplate>
<br />
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# DataBinder.Eval(Container.DataItem, "Value", "") %>'><%# DataBinder.Eval(Container.DataItem, "Key", "") %></asp:HyperLink>
</ItemTemplate>
</asp:Repeater>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</KWizCom:ResentDiscussions>
</td>
</tr>
</table>
</Template>
</SharePoint:RenderingTemplate>

To remove the created by/modified by section

<td nowrap class="ms-descriptiontext" id="onetidinfoblock1">
                                    <SharePoint:FormattedString ID="FormattedString1" FormatText="<%$Resources:wss,form_createdby%>"
                                          runat="server">
                                          <SharePoint:FormField ID="FormField2" ControlMode="Display" FieldName="Created" DisableInputFieldLabel="true"
                                                runat="server" />
                                          <SharePoint:FormField ID="FormField3" ControlMode="Display" FieldName="Author" DisableInputFieldLabel="true"
                                                runat="server" />
                                          <SharePoint:CreationType ID="CreationType1" runat="server" />
                                    </SharePoint:FormattedString>
                                    <KWizCom:RegionalSettingsTimeStamp ID="RegionalSettingsTimeStamp1" runat="server" />
                              </td>
                        </tr>
                        <tr>
                              <td nowrap class="ms-descriptiontext" id="onetidinfoblock2">
                                    <SharePoint:FormattedString ID="FormattedString2" FormatText="<%$Resources:wss,form_modifiedby%>"
                                          runat="server">
                                          <SharePoint:FormField ID="FormField4" ControlMode="Display" FieldName="Modified"
                                                DisableInputFieldLabel="true" runat="server" />
                                          <SharePoint:FormField ID="FormField5" ControlMode="Display" FieldName="Editor" DisableInputFieldLabel="true"
                                                runat="server" />
                                    </SharePoint:FormattedString>
                                    <KWizCom:RegionalSettingsTimeStamp ID="RegionalSettingsTimeStamp2" runat="server" />
                                    <br />
                              </td>
                              <td nowrap class="ms-descriptiontext">
                                    <KWizCom:WikiPageCounter ID="WikiPageCounter1" ControlMode="Display" runat="server" />
                              </td>

Rate this Article:

Add Your Comments



Comments require login or registration.

Details

Last Modified:3 Months Ago
Last Modified By: dean
Type: HOWTO
Article not rated yet.
Article has been viewed 200 times.

Options