<xmod:comments>

New to version 5.0

TEMPLATE CONTROL: This tag is valid in list view and detail templates.

 

DESCRIPTION:

Provides users with a way to add and manage comments for a given XMod record.

 

 

ATTRIBUTES <xmod:comments>:

commentsdisplay

The number of comments to display per page. A value of "1" (without quotes) will display one comment per page. If this is not specified, no comments will be displayed.

allowcomments

Enables or disables the posting of comments

numbercomments

Used together with the attribute commentsfrequency to create a toggle control for the number of comments a user can post in a certain time frame.

  • -1 makes the amount infinite and completely disregards the commentsfrequency attribute.
  • 0 disables comments
  • Other positive integer defines the number of comments that can be posted per (commentsfrequency interval)

commentsfrequency

An interval that defines how many comments can be posted by a user. Valid values are: always, minute, hour, day, week, month

sortorder

The order in which the comments will be displayed in the comments system. Valid values are

  • NewestFirst: The most recently added comments appear first in the list
  • OldestFirst: The The most recently added comments appear last in the list.

requireapproval

Determines whether all comments must be approved by an administrator (true) or whether they are auto-approved (false).

 

CHILD TAGS

<header>

Text and HTML that will appear in the first row of the comments area

 

<itemtemplate>

Text and HTML that will appear in odd-numbered rows. So, for instance, the first comment, the third comment, and the fifth comment. If no alternating item template is specified, then the item template applies to all rows. Within the <itemtemplate> and <alternatingitem> tags, you can use the following placeholders to position comment-related data (note, placeholder names are case-sensitive):

 

<alternatingitem>

Text and HTML that will appear in even-numbered rows. So, for instance, the second comment, the fourth comment, and the sixth comment. If no alternating item template is specified, then the item template applies to all rows. Within the <itemtemplate> and <alternatingitem> tags, you can use the following placeholders to position comment-related data (note, placeholder names are case-sensitive):

 

<footer>

Text and HTML that will appear in the last row of the comments area

 

<ratings> 

ATTRIBUTES <ratings>:

location

Defines where the images are stored. Valid values are “portal”, “xmod” and “url”. New to 5.0.3

fullimage

File name for the image that represents a full value. If URL is selected then the whole path to the image is needed. New to 5.0.3

emptyimage

File name for the image that represents an empty value. If URL is selected then the whole path to the image is needed.. New to 5.0.3

<editor>

 ATTRIBUTES <editor>:

username

The text to be displayed for the “Username:” label.

text

Default text for the editor textarea.

class

Assign a CSS class name to the editor.

style

Assign CSS class styles to the editor.

height

Define the height in pixels of the editor box.

width

Define the width in pixels of the editor box.

<submitbutton>

  ATTRIBUTES <submitbutton>:

text

The text to be displayed for the button that submits a comment. Default value is from resource file entry “btnSubmitText.Text”

class

Assign a CSS class name to the submit button.

style

Define an inline CSS style for the submit button.

display

Define the type of button to use: Button, LinkButton or ImageButton. Default value is linkbutton.

imageurl

If the ImageButton display type is selected. Defines the URL of the image to display.

height

Height in pixels of the button.

width

Width in pixels of the button.

onclick

Option that can be used to assign Javascript to the onclick properties of the button.

<pager>

   ATTRIBUTES <pager>:

enabled

Defines whether navigating through different pages of comments will be enabled. Valid values are true and false.

positioning

Defines the positioning of the two pager buttons. “Above” and “below” the comments are the valid values.

nexttext

Text for the button that navigates to the next page. If left blank and display is set to LinkButton, no link will be displayed.

prevtext

Text for the button that navigates to the previous page. If left blank and display is set to LinkButton, no link will be displayed..

class

Assign a CSS class for both buttons.

style

Assign inline CSS styles for both buttons.

display

Type of button to display for the pager buttons (Button, LinkButton, or ImageButton) Default is linkbutton.

nextimageurl

The URL of the image to be displayed if the pager buttons are ImageButton. Note: you can use the tilde character "~" as a shortcut to get to the root directory of the website like so:
~/images/next.gif

previmageurl

The URL of the image to be displayed if the pager buttons are ImageButton. . Note: you can use the tilde character "~" as a shortcut to get to the root directory of the website like so:
~/images/prev.gif

height

Height for both of the pager buttons

width

Width for both of the pager buttons.

prevonclick

Set the onclick html attribute for the previous button.

nextonclick

Set the onclick html attribute for the next button.

<showeditorbutton>

    ATTRIBUTES <showeditorbutton>:

opentext

The text that is displayed when the comment editor box is hidden

Hidetext

The text that is displayed when the comment editor box is visible.

Class

Assign a CSS class name to the show editor button.

Style

Define an inline CSS style for the show editor button.

Display

Display: Define the type of button to use: Button, LinkButton or ImageButton. Default is linkbutton.

Imageurl

If the ImageButton display type is selected. Defines the URL of the image to display.

Height

Height in pixels of the button.

Width

Width in pixels of the button.

onclick

Option that can be used to assign Javascript to the onclick properties of the button.

EXAMPLE

<div style="width: 550px; text-align: left;">

  <h1 style="text-align: center;"><xmod:field name="MovieTitle"/></h1>

  <p style="font-family: Verdana;">

    <span style="font-weight: bold;">Plot:</span> <xmod:field name="Synopsis"/></p>

  <div style="text-align: center;">

    <img width="150" height="218" src="<xmod:field name="MovieArt"/>" alt="<xmod:field name="MovieTitle"/>" />

  </div>

  <br />

  <h2>User Ratings</h2>

  <xmod:ratings location="portal" fullimage="fullStar.gif" emptyimage="emptyStar.gif" ratingscale="5" allowratings="true" />

  <br />

  <br />

  <xmod:comments commentsdisplay="5" allowcomments="all" numbercomments="1" commentsfrequency="minute" sortorder="NewestFirst" requireapproval="false">

    <itemtemplate>

      <span><div style="background-color: silver;" class="UserComment"> <b>{username}</b> - <i>{postdate}</i></div></span>

      <span><div style="text-align: left;"> {comment} <br><br> </div></span>

    </itemtemplate>

    <alternatingitemtemplate>

      <span><div style="background-color: lightblue;" class="UserComment"> <b>{username}</b> - <i>{postdate}</i> </div></span>

      <span><div style="text-align: left;"> {comment} <br /><br /> </div></span>

    </alternatingitemtemplate>

    <header>

      <h2 style="font-family: verdana; size: 8px;">User Comments</h2>

    </header>

    <editor style="width:500px;" label="Comment:" username="Your name:"/>

    <submitbutton text="Submit Comment" />

    <pager enabled="true" nexttext="Next" prevtext="Previous" display="button" />

  </xmod:comments>