Using the In-line abuse report web part in transformations

The Inline abuse report web part appears as a link with the text 'Report abuse'. After clicking the link, a dialog appears, letting the site visitor send abuse report to the site administrators. This web part is mainly used in transformations, letting you include the Report abuse link repeatedly where ever you need.

 

The object viewer that is being used by this web part can handle only blog comments, message board messages and forum posts. If you use the web part in transformations of some other objects, the "Show object details" link will not be displayed in its abuse reports' properties.

 

In the following example, you will learn how to add the Inline abuse report web part to the default transformation of a message board message on our sample Corporate Site.

 

1. Go to CMS Desk, switch to the Edit mode and its Design tab.

 

2. In the content tree, select Examples -> Webparts -> Message boards -> Message board.

 

3. Choose to Configure (Icon_Configure) the MessageBoard web part.

 

4. In the web part properties window, choose to Edit the Message transformation property.

 

5. Replace the transformation code with the following code. It is the original code of the transformation with the highlighted parts added. The first highlighted part is registration of the webpart tag, the second one is a <div> containing the web part itself:

 

<%@ Register Src="~/CMSModules/MessageBoards/Controls/MessageActions.ascx" TagName="MessageActions" TagPrefix="cms" %>

 

<%@ Register Src="~/CMSModules/AbuseReport/Controls/InlineAbuseReport.ascx" TagName="InlineAbuseReport" TagPrefix="cms" %>

 

<div class="CommentDetail">

  <asp:Panel ID="pnlRating" runat="server" />

  <table width="100%">

      <tr>

          <td class="CommentUserName" style="width: 100%">

               <%# IfEmpty(Eval("MessageURL"), Eval("MessageUserName"), "<a href=\"" + Eval("MessageURL") + "\" target=\"_blank\">" + Eval("MessageUserName") + "</a>")%>              

          </td>

      </tr>

      <tr>

          <td class="CommentText">

               <%# CMS.GlobalHelper.TextHelper.EnsureLineEndings(Convert.ToString(Eval("MessageText")), "<br />")%>

          </td>

      </tr>

      <tr>

          <td class="CommentDate">

               <%# GetDateTime(Eval("MessageInserted")) %>

          </td>

      </tr>

      <tr>

          <td align="right" class="CommentAction">

              <div class="buttonpedding">

                       <cms:MessageActions ID="messageActions" runat="server" />

              </div>

          </td>

      </tr>

  </table>

</div>

 

<div class="BlogPDateWhole">

<cms:InlineAbuseReport ID="InlineAbuseReport" runat="server" ReportObjectType="board.message" ReportObjectID='<%# Eval("MessageID") %>'  ReportTitle="Message board abuse report" />

</div>

 

<hr style="border: 1px solid #CCCCCC;"/>

 

6. Click Save. Now if you switch to the Live site and view the message board, you should be able to see the Abuse report link below each of the messages:

 

clip0038

 

7. If you click it, the screen will become grayed out and the following dialog will pop up in the middle of it, as you can see in the screenshot below. Type in some report text and click the Report abuse button. The report will be logged in CMS Desk -> Tools -> Abuse report.

 

clip0039