Was this article helpful?

Comments

Last modified 07:46, 8 Oct 2014
Table of Contents
  1. 1. Introduction
    1. 1.1. How it Works
    2. 1.2. Major Features
  2. 2. Quick Start - Setup and Integration
    1. 2.1. Setting up a New Comment Category
    2. 2.2. Integrating the Plugin Code into Your Site
      1. 2.2.1. Category ID
      2. 2.2.2. Stream ID
  3. 3. Running Example
  4. 4. Configuration and Administration
    1. 4.1. Changing to 'Read Only'
    2. 4.2. Moderation
    3. 4.3. Moderator Comments
    4. 4.4. Highlighted Comments
      1. 4.4.1. Highlight Moderators
      2. 4.4.2. Highlight User Groups
      3. 4.4.3. Highlight Comments
    5. 4.5. User Login
      1. 4.5.1. Adding Guest Login
      2. 4.5.2. Adding Site Login
    6. 4.6. Social Network Publishing
    7. 4.7. Layout Customization
      1. 4.7.1. Pagination
      2. 4.7.2. Comment Box Location
      3. 4.7.3. Show Newly Added Comments
      4. 4.7.4. Displaying Number of Comments
      5. 4.7.5. Displaying Subscribe Links
    8. 4.8. Other Settings
      1. 4.8.1. Comments Threading
      2. 4.8.2. Replies Default View
      3. 4.8.3. Google Analytics Social Data Hub Integration
      4. 4.8.4. In-line Tagging of Commenters
      5. 4.8.5. Maximum Comment Length
      6. 4.8.6. Displaying Facebook Comments
      7. 4.8.7. Allow Users to Delete their own Comments
      8. 4.8.8. Enabling Voting on Comments
      9. 4.8.9. Like Button
      10. 4.8.10. Sorting Comments
      11. 4.8.11. Enable Rich Text Formatting
      12. 4.8.12. Enable Embedding Media Items
      13. 4.8.13. Anonymous Posts 
    9. 4.9. Notifications
    10. 4.10. Site Restrictions
    11. 4.11. Commenting Rate Limit
    12. 4.12. Importing Commenting Systems
  5. 5. Comment Stream Subscriptions and Notifications
    1. 5.1. Notification of Comments Replies
    2. 5.2. Subscribing to Comments
    3. 5.3. Comment Email Templates
      1. 5.3.1. Default Stream Subscription Email
      2. 5.3.2. Default Comment Reply Email
      3. 5.3.3. Content of Email Templates
      4. 5.3.4. Creating Customized Emails
  6. 6. UI Custom​izations
    1. 6.1. Template Classes
      1. 6.1.1. Comments Plugin (commentsPlugin)
      2. 6.1.2. Header (header)
      3. 6.1.3. Updates (updates)
      4. 6.1.4. Comment (comment)
      5. 6.1.5. Compose Box (composebox)
      6. 6.1.6. My Review (myReview)
      7. 6.1.7. Running Example
      8. 6.1.8. Example Code
    2. 6.2. HTML Elements Style (CSS)
  7. 7. Sharing Comments to Social Networks
      1. 7.1.1. Step 1: Construct a UserAction Object 
      2. 7.1.2. Step 2: Include the shareUserAction in the Comments plugin's parameters
  8. 8. Comments UI in Mobile View
  9. 9. Comments Counter in Share Bar
  10. 10. Browsers Compatibility
  11. 11. Mobile Compatibility
  12. 12. Right-to-Left Localization
  13. 13. Responsive Design
  14. 14. Support for Custom Texts
  15. 15. Search Engine Optimization (SEO) Support

Introduction

Gigya's Comments plugin enables site users to post comments and have discussions about published content on the site.

This guide walks through the Comments plugin setup and integration and serves as a reference document for the configuration and customization options.

Gigya offers a new improved version of the comments plugin (version 2), which differs from the original plugin in the following ways:

  • New visual layout
  • Sharing comments to social networks
  • Support for rich text editor
  • Allowing user sorting of comments
  • Support for comment highlighting
  • Allowing logged-in users to post an anonymous comment or review
  • In-line tagging of commenters
  • Right-to-left localization
  • Responsive design
  • Support for custom texts

Using the new Comments plugin version is very simple, just ​add the version parameter to the params of comments.showCommentsUI method, and set it to 2: 

var params =  { 
    categoryID: 7623701,
    streamID: '',
    containerID: 'commentsDiv',
    version:2
}

This guide also includes an explanation on how to make the comments in your Comments plugin searchable using Search Engine Optimization (SEO) Support​.

 

Note: if you wish to use the plugin for Rating & Reviews please follow the designated guide.

 

How it Works

The plugin presents:

  • A "Write a comment" canvas. The "Write a comment" canvas has two states: when the current user is logged-in and when he is logged-out.
  • Comments stream

The default look of the Comments plugin (logged-out state):

CommentsUI2_logged-out.gif

When a user clicks inside the "Write a comment" canvas, it expands and the Login UI appears, along with the "Post" button, and the editor icon, which enables the user to format the text:

CommentsUI2_expand.gif

If a user tries to post a comment when not logged in, he is prompted to either login or post a comment as a guest:

CommentsUI2_post.gif

Note: By default, the user is prompted to login, without the "As Guest" option. In order to be able to post a comment as a guest, you must specify it in the comments configuration. See Adding Guest Login section.

 

You can use the showLoginBar parameter in comments.showCommentsUI to display the Login bar at the top of the textbox:

CommentsUI2_showlogin.gif

Note: By default the Guest option isn't displayed. In order to be able to post a comment as a guest, you must specify it in the comments configuration. See Adding Guest Login section.

 

The default look of the Comments plugin (logged-in state):

CommentsUI2_logged-in.gif
 

In the logged-in state, the "Write a comment" canvas includes

  • User's profile picture and nickname of the logged in user. Note that the user screen name (userName) is pulled from the profile.nickname and not the profile.username​.
  • Commenting input box.
  • A collapsed sharing panel (checkboxes with social network icons) - provides an option to share a posted comment to social networks. 
  • A "Follow replies to my comments" link that once clicked notifies the user when someone replies to his comments. 
  • A plus sign that once clicked offers more options of sharing destinations.

 

Major Features

  • The plugin provides an integrated social login:
    • Through a social network account. Such case may initiate a user sign-up to your site.
    • Using the site credentials.
    • As a guest user.
  • The Comments plugin graphic design is highly customizable (read more in the UI Customizations section below).
  • Comment threads - replies to a comment.
  • Export current comments through RSS/XML format.
  • Following replies to comments.
  • Importing 3rd party commenting systems.
  • Moderation.
  • Highlighting comments.
  • Rich text editor.
  • Server side administration: use the Comments Setup page on Gigya's website to define categories for comments and customize each comment category settings.
  • Sharing comments to social networks.
  • Support multiple comments streams per category.
  • Supports publishing a posted comment to one or more social network destinations. This enables users to share their comments with their social networks friends.
  • Subscribing to comments streams by email.

 

Quick Start - Setup and Integration

This section is a quick integration guide. Follow the step below to integrate the Comments plugin with its default settings into your site.
The integration process includes broadly two stages:

  1. Setting up a New Comment Category on Gigya's website
    Note: This step is necessary only when integrating the first instance of the Comments plugin in your site. When integrating more instances, you can reuse the same settings and jump to stage 2.
  2. Copying the generated code from Gigya's website and integrating the code into your site 
     

Setting up a New Comment Category

Every Comments plugin instance belongs to a Comments category. The Comments category provides the option to define a group of Comments plugin instances that share the same settings. You may define one or more Comments categories for your domain. Each category may be configured to have different settings. The settings are defined on the server side and may be administrated using the Comments Setup section of Gigya's website. Follow the steps below to create a new Comments category:

  1. Go to the Comments Setup section of Gigya's website. Please make sure your are signed in. The Comments Setup page may also be accessed by clicking "Settings" in the upper menu and then "Comments" in the left menu.
     
    CommentsSetup1.gif
     
  2. Click the 'Add new comment category' button:
    CommentsSetup2.gif
     
  3. Fill in a new category name and select the 'Comments' radio button:
    CommentsSetup3.gif    
     
  4. Click "OK". A new Comments Category instance is created. Notice the newly created row in the Comments categories table:
    CommentsSetup4.gif
    The JavaScript code under "Embed code" column is the generated code that you will integrate in your site (next step). The code includes a generated unique categoryID that identifies the newly created category.
    The "Comments Settings" button leads to an administration screen that lets you change the default settings of the Comments category. This subject is broadly explained in the Configuration and Administration section below.

 

Integrating the Plugin Code into Your Site

The simplest and fasted way to integrate the Comments plugin in your site is to copy the "Embed code" from the category row and paste it into the spot in the <body> part of your web page in which you want the plugin to appear.

CommentsSetup5.gif

<script src="http://cdn.gigya.com/JS/gigya.js?apiKey=2_Y82PzwJ_chSFImHXaIDJClnLyJzmk-VFOavSsaNTzl6m901s_NNxRAS0xJ3bd3_N" 
type="text/javascript"></script>
<div id="commentsDiv"></div>
<script type="text/javascript">
    var params =
    {
        categoryID: 7623701,
        streamID: '',
        version: 2,
        containerID: 'commentsDiv',
        cid:'',
        enabledShareProviders: 'facebook,twitter,linkedin'
    }
    gigya.comments.showCommentsUI(params);
</script>

 

The best practice though, is to cut the first line of code and move it to the <head> section of your page. This line loads Gigya's JS library file.

The outcome is:

<html>
<head>
    <script src="http://cdn.gigya.com/JS/gigya.js?apiKey=2_Y82PzwJ_chSFImHXaIDJClnLyJzmk-VFOavSsaNTzl6m901s_NNxRAS0xJ3bd3_N" 
        type="text/javascript"></script>
</head>
<body>
    <div id="commentsDiv"></div>
    <script type="text/javascript">
 
        var params =
        {
            categoryID: 7623701,
            streamID: '',
            version: 2,
            containerID: 'commentsDiv',
            cid:'',
            enabledShareProviders: 'facebook,twitter,linkedin'
        }
        gigya.comments.showCommentsUI(params);
    </script>
</body>
</html>

The above code is of a basic web page that includes only the Comments plugin. See this code in action in the Running Example below.

Category ID

Notice the categoryID in line 12. This ID was generated by Gigya and is a unique identifier for the Comments category that you have defined in the previous step.

Stream ID

Notice the streamID in line 13. The streamID identifies a stream of comments within a Comments category. The ID is now empty, meaning that we have a single stream with an empty identifier. Two Comments plugin instances that share the same categoryID and streamID will show the same comments.
To create several instances of Comments plugins that belong to the same category, copy the same code to different spots in your site where you wish to insert the plugin. In each spot, assign a different identifier (string) to the streamID. We suggest using the permalink as the streamID. Note: streamID is limited to 150 characters and is case-sensitive.

Running Example

 

Configuration and Administration

If you go back to the Comments Setup page, in the Comments category row that you have created, you will see a "Comments Settings" button. Clicking this button leads to the Comments Settings page. This page is an administration screen that lets you change the default settings of the Comments category.

CommentsSettings1.gif

You may change the settings as you choose and then save them by clicking the "Save changes" button at the bottom of the page. The changes are saved in Gigya's database (server side). No coding changes are required. The change will take effect immediately. For a page that is already loaded, refresh the page and you will see the change.

The available configuration options in this page:

 

Changing to 'Read Only'

CommentsSettingsStatus.jpg

The 'Status' property is 'Enabled' by default, meaning that users are able to submit comments.
If you change the Status to 'Read only', users will only be able to read comments. Graphically, the 'Post a new comment' canvas is not displayed.

 

Moderation

Gigya's commenting service supports moderation administration. This section of the Comments Settings page includes moderation settings, including notification email, moderation mode, and more. Read more in the Comments Moderation dedicated guide.

 

Moderator Comments

In this section you can also choose how moderator commenter names and photos will appear in comment streams when they reply to comments. Read more in the Comments Moderation dedicated guide.

 

Highlighted Comments

Comments highlighting allows to make certain comments or reviews in your site stand out from the rest.

There are three main reasons for you to want a comment or review to stand out: 

  1. It is a reply by a moderator, and you want these replies to be automatically highlighted.
  1.  It is written by a "special user", such as site staff, a journalist, or an expert.
  1. It is highlighted by a moderator as a "recommended" comment - "Editor's pick".
 

Notes:

  1. Only comments of logged-in users can be highlighted.
  2. Highlighting and removing highlighting will only affect future comments posted by the users.

 

Highlight Moderators

​​Comments posted by moderators will include a unique visual indication, as previewed in the following table:

highlight_moderator.gif

The status is "on" by default, meaning that highlighting of moderator comments is enabled.

To edit the settings of the Moderators group, click the edit icon under the Settings column:

highlight_edit_group.gif

Any changes you make will be shown to you in the "Preview" section. You can:

  • Choose not to show the "Moderator" badge, in which case only the moderator name will appear.
  • Change the text that will appear in the badge, by checking the "Customize" box and entering a new name in the text box instead of the default "Moderator".
  • Change the badge color, by choosing a different color from the drop-down menu. 
  • Choose not to color the commenter's name, or to change the default color, by choosing a different color from the drop-down menu.

The comments plugin will display the moderator comments according to the settings you defined here:​​

highlight_plugin_moderator.gif

In this case the text of the "Moderator" badge has been customized, and changed to "hello". The color of the "hello" badge and the color of moderator's name have not been changed.

 

Highlight User Groups

 Comments posted by users within the specified groups will include a unique visual indication, as previewed in the following table:

highlight_groups.gif

Use the Comments Moderation site to assign users to these groups.

The status is "off" by default, meaning that highlighting of user groups comments is disabled. Change the status indicator to "on" to enable highlighting of a specific group.

There are three available custom groups by default : Staff, Expert, and Journalist. To edit the settings of any of the groups, click the edit icon under the Settings column of that group:

highlight_staff.gif

Any changes you make will be shown to you in the "Preview" section. You can:

  • Choose not to show the "Staff" badge, in which case only the commenter's name will appear.
  • Change the text that will appear in the badge, by checking the "Customize" box and entering a new name in the text box instead of the default "Staff".
  • Change the badge color, by choosing a different color from the drop-down menu. 
  • Choose not to color the commenter's name, or to change the default color, by choosing a different color from the drop-down menu.

You can also delete any of the groups in this section.

Adding a group is done by clicking the "Add new group" button. The following dialog will open:

highlight_new_group.gif

Enter a group name, decide whether to show a badge, and if chosen, enter the text and choose the color of the badge. Then decide whether to color the commenter names, and pick a color from the drop-down menu. Click "Create", and the new group will be added to the table. 

The comments plugin will display the custom group comments according to the settings you defined here:​​

highlight_plugin_staff.gif

In this case the user belongs to two groups: Journalist and Staff, each with their own badge and color.

If the user is highlighted, the highlighting badges are also shown in the post box.

 

Highlight Comments

 Specific comments that are highlighted via the Comments Moderation site will feature a unique visual indication, as previewed in the following table below:

highlight_comment.gif

The status is "off" by default, meaning that highlighting of specific comments is disabled. Change the status indicator to "on" to enable highlighting of a comments.

There is one available custom group by default : "Editor's Pick". To edit the settings this groups, click the edit icon under the Settings column:

highlight_comments.gif

Any changes you make will be shown to you in the "Preview" section. You can:

  • Choose not to show the "Editor's Pick" badge, in which case only the background will appear.
  • Change the text that will appear in the badge, by checking the "Customize" box and entering a new name in the text box instead of the default "Editor's Pick".
  • Change the default image, by entering a new image URL
  • Change the badge color, by choosing a different color from the drop-down menu. 
  • Choose not to color the background, or to change the default background color, by choosing a different color from the drop-down menu.

You can also delete the of the group.

Adding a group is done by clicking the "Add new group" button. The following dialog will open:

highlight_new_group1.gif

Enter a group name, decide whether to show a badge, and if chosen, enter the text and choose the color of the text badge. You can also change the badge image, by entering a new image URL. Then decide whether to color the background, and pick a color from the drop-down menu. Click "Create", and the new group will be added to the table. 

The comments plugin will display the highlighted comments according to the settings you defined here:​​

highlight_plugin_comment.gif

 

User Login

This section controls the login canvas, which is contained in the "Write a comment" canvas. If a user tries to post a comment when not logged in, he is prompted to login:

CommentsUI2_default_login.gif

 

Another option is to add the Login bar to the Comments plugin, by setting the showLoginBar parameter in comments.showCommentsUI:

CommentsUI2_showlogin.gif 

 

Adding Guest Login

Adding guest login is simple: Check the "Allow guest comments" checkbox and click the "Save changes" button at the bottom of the page. Refresh your comments page and see the additional "Guest Login" in the login bar:

commentsUI2_guest.gif

If you set the "Allow guest comments" radio button to "Yes", you will also see the "As Guest" option in the login plugin:

CommentsUI2_post.gif

 

You can also decide whether an email address is required for guest users, and if to request a required nickname from the guest:

commentsSettingsGuests.gif

If all three checkboxes are checked then when a user clicks the "Guest" button he is prompted to insert a nickname and an email address:

commentsUI2_guest2.gif

If an email is not required, or the guest nickname is not requested, the plugin will not display the relevant textbox. 

 

Adding Site Login

Adding site login is a bit more complex:

var params =  { 
    categoryID: 7623701,
    streamID: '',
    version: 2,
    containerID: 'commentsDiv',
    useSiteLogin: true,
    cid:''
}

You will now see the site login button instead of the Gigya Login button. When you set the comment with useSiteLogin=true, clicking the Post button will be the same as clicking the Login button except the comment won't be automatically posted. 

If you want the comment automatically posted after the site Login event, add a callback function to the event object of onSiteLoginClicked.  This will be called when the user finishes logging-in. For example:

// onSiteLoginClicked event handler
function onSiteLoginClicked(event) {
    // set GAC from server side
   event.callback();
}

 

 
  • Clicking the site login button at the bottom of the page fires an onSiteLoginClicked event. To register to this event, set the onSiteLoginClicked parameter of the comments.showCommentsUI method with a reference to an event handler function. This function should open a popup or redirect the user for the site login page. The following sample code illustrates this:
    // onSiteLoginHandler event handler
    function onSiteLoginHandler(event) {
        // Site Login button clicked
        // open a popup or redirect the user for the site login page}
    
    var params =  { 
        categoryID: 7623701,
        streamID: '',
        version: 2,
        containerID: 'commentsDiv',
        useSiteLogin: true,
        onSiteLoginClicked: onSiteLoginHandler,   // registering to the onSiteLoginClicked event
        cid:''
    }
    
    gigya.comments.showCommentsUI(params);
    Note: the popup or site login page should include Gigya's Login Plugin.  

 

Social Network Publishing

CommentsSettings_SN.gif

The 'Share to social network' check box is checked by default, meaning that the comments submitted by the users are shared to the selected social network or networks.
If you change the check box to unchecked, the users will be able to submit comments, but the comments will not be shared to social networks.

 

Layout Customization

This section allows you to change a few aspects of the Comments plugin layout settings:

CommentsSettings_layout.gif

Pagination

Pagination refers to dividing the comments into pages. The default is a display of 25 comments per page, but you may choose to change the number of comments per page using the drop-down menu.

 

Comment Box Location

The Comment box refers to the 'Post your review' canvas. By default it is located above the  comments stream, at the top of the plugin. You may change this by checking the 'Bottom' radio button. As a result the canvas will appear below the comments stream, at the bottom of the plugin.

 

Show Newly Added Comments

This section allows you to specify whether the plugin should be refreshed in real-time and show newly added comments that were posted after the user has entered the page where the plugin is displayed.
This drop-down menu allows you to select one of the following three options:

  • Off - when selected, do not show notifications for new comments. This is the default option. This means that the comments plugin will not show the new comments that were posted after entering the page where the plugin is displayed.
  • Show only new comments count - when selected, display the number of new comments. When this option is selected, the comments plugin will display the counter of the new comments and a link. The user will be able to click the "Click to show" link in order to display the new comments.
    CommentsUI2_new_comments.gif
  • Automatically show new comments - when selected, all new comments will be displayed automatically.​
 
Note: No matter what setting is selected for the "Show Newly Added Comments", there is no impact on the page performance.

When the setting is "Automatically show new comments", you can pause the comments stream by clicking the "Pause live stream":

pause.gif

Click the "Resume live stream" link to continue the comment stream.

 

Displaying Number of Comments

The checkbox allows you to display or hide the number of comments in the stream.

 

Displaying Subscribe Links

You can choose whether to display an RSS button and a Subscribe button. This allows users to subscribe to comments streams by email. Read more in the Subscribing to Comments section.

 

Other Settings

This section allows you to change the default settings of:

  • Comment sorting, including different sorting options and allowing user sorting. 
  • Comments threading
  • Displaying Facebook comments
  • Allowing users to delete their own comments
  • Enabling embedding of media
  • Enabling Google Analytics Social Data Hub integration
  • Enabling in-line tagging of commenters
  • Enabling rich text formatting
  • Enabling voting on comments, including allowing negative voting and showing separate counter for negative voting
  • Maximum comment length
  • Replies default view
  • Allowing logged-in users to post an anonymous comment or review

CommentsSettings_Other.gif
 

Comments Threading

By default comments threading is allowed, meaning that replies to comments are allowed and displayed in a nested manner. If you prefer not to allow comments threading, select the 'No' radio button.

You may choose the depth of the threading, from 1 to 5, using the drop-down menu. The default threading depth is 5.

 

Replies Default View

You can decide whether the replies to the comments will be displayed in expanded or collapsed view.

 

Google Analytics Social Data Hub Integration

Gigya supports integration with Google Analytics Social Data Hub. By selecting the 'Yes' radio button, you allow Gigya to publish your comments streams to Google Analytics via the PubSubHubbub (PSHB) protocol.

 

In-line Tagging of Commenters

You can allow commenters to tag other commenters from the comment stream. 

When this option is checked, you can easily enter the commenter you want tagged, either by :

  • Clicking the "tag commenter button". When you click the icon, the commenters in this stream will be displayed and you may choose one or more to add to the comment (up to 15):
    comments_tag_icon.gif

 

  • Or by entering a "@" symbol in the text box, in which case, the plugin will display an auto-completion drop-down list that contains the list of commenters. When you continues to enter (or change) text, the drop-down will be filtered by the entered text, and you can select the commenter.
    comments_tag_@.gif

     

Once you tag a commenter (or commenters), you may post the comment:
comments_tag_post.gif

The tagged commenter will receive a notification email regarding the tagging if he selected "Follow replies to my comments". 

In mobile versions the tag in the comments is supported, though at this time tagging commenters is not yet supported.

 

Maximum Comment Length

You may select the maximum length of the comments. If you do not set this value, the default maximum length of the comments is 5000 characters.

 

Displaying Facebook Comments

Note: Facebook have changed their policy and no longer support replies to comments. Gigya are exploring methods of keeping this functionality operational, but at present it is not supported.

You can choose to display the Facebook comments stream as part of the Comments plugin. The comments from Facebook are marked 'Via Facebook':

CommentsUI2_fb.gif

In order to be able to view Facebook comments, the Facebook privacy settings regarding posts should be set to 'Everyone'.

You must also define a UserAction object, provide an action link and add the actionLink  the to your userAction object:

// Define a UserAction object:
var ua = new gigya.socialize.UserAction();
ua.addActionLink('Gigya','http://www.gigya.com');

// Define Comments plugin's Parameters:
var params ={
    userAction:ua,
    categoryID: 7623701,
    streamID: '',
    containerID: 'commentsDiv',
    version:2
}

// Load Comments plugin:
gigya.comments.showCommentsUI(params);

 

Allow Users to Delete their own Comments

When you check the checkbox, a "Delete" button appears, allowing a logged-in users to delete their own comments:

CommentsUI2_delete.gif

 

Enabling Voting on Comments

The "Enabling voting on comments" checkbox determines whether to make voting on comments available for users. 

  • "Allow negative voting" determines whether users will be able to vote negatively (thumbs down) on comments. If these two check-boxes are checked, the Comments Plugin shows a set voting icons next to each comment. If negative voting is not permitted (default configuration), a "like" button is displayed in addition to the regular thumbs up button.
  • "Show separate counter for negative voting" determines whether to place a separate counter for negative votes (thumbs down) on comments. If these two check-boxes are checked, the Comments Plugin shows a set voting icons next to each comment, with separate counters.

 

Like Button

In addition to the regular thumbs up button, a Like button appears:

comments_like.gif

Once the Like button is pressed, the thumbs up icon turns to green, and the "Like" turns to "Unlike". When the "Unlike" is pressed, the thumbs up icon changes back to gray, and the "Unlike" changes to "Like".

To disable this feature, set streamSettings.allowNegativeVoting to "true", using comments.setCategoryInfo. The outcome will be that the thumbs up and thums down will appear, and the Like button won't.

 

Sorting Comments

The comments can be displayed in different orders.

If the "Enabling voting on comments" checkbox is not checked, you may sort the comments according to one of the following orders:

  • Most recent on top (default) - the comments are sorted by the timestamp of the post. The first comment is the latest one (most recent).
  • Most recent on bottom - the comments are sorted by the timestamp of the post. The first comment is the oldest one (least recent).
  • Most relevant on top - the thread with the most recent reply is displayed first.

If the "Enabling voting on comments" checkbox is checked, you have two additional sorting options:

  • Most voted on top - the comments are sorted by the overall votes value (positive votes minus negative votes) of the root comment in each thread. The first comment is the one that has the highest votes.
  • Most voted on bottom - the comments are sorted by the overall votes value (positive votes minus negative votes) of the root comment in each thread. The first comment is the one that has the lowest votes.

You can also allow users to sort the comments in a different way than as it was preset by the site. The sort options are the displayed in a drop-down menu. Once a new sort is selected by the user, the comments are reloaded according to the new sort. 

 

Enable Rich Text Formatting

When you select this check box, the comments users are able to perform text formatting on all new comments. A formatting toolbar is displayed, and when a user clicks on any of the format buttons, the format of the selected text in the comment is changed accordingly.

CommentsUI2_rich_text.gif

 

Enable Embedding Media Items

The plugin enables you to embed media items of supported providers to your comments.

When you check the "Enable embedding media" checkbox, you will see the "attach" icon:
comments_attach.gif

 
Note: In order attach a media item, you must be logged-in, either as a guest user, or via a social network.

When clicking on the "attach" icon, the plugin will open an "add media item" dialog:

comments_embed_dialog.gif

Enter the URL of the embedded media item you wish to add to the comment.

You can embed:

  • An image
  • An audio
  • A video

For example, the following image shows an embedded video item from Vimeo:
comments_embed_video.gif

The supported vendors are: Youtube, Vimeo, Picasaweb, Flicker, CNN, Facebook, Pinterest, Twitter, SoundCloud, Instagram, Imgur, Twitter Pics, Tumblr, Spotify, rdio, last.fm, Pandora, smugmug, PhotoBucket,  Ustream, CollegeHumor, FunnyOrDieThe Onion, and dropbox.

 

Anonymous Posts 

The plugin enables you to allow logged-in users to post an anonymous comment or review.

When you check the "Allowed anonymous post by logged-in users" checkbox, the plugin displays a checkbox that when checked, it enables the user to post anonymously:

Comments_anonymous.gif

If non-logged-in users want to post anonymously, they can post as guests.

 

Notifications

This section allows you to register a callback URL which will be sent notifications when a new comment event is triggered or when a comment status change event is triggered. Comment statuses can be "published", "pending", "flagged", or "rejected" (see the comment object).

notifications.png

Notifications are sent as an HTTP/HTTPS post. For details of their content, see Comment Notifications

Notifications can also be generated using the comments.setCategoryInfo API.

 

Site Restrictions

Gigya offers you the option to manage a custom black list of words and phrases to be filtered in comments, and to block IP addresses. You can read more in the Site Restrictions section, or go directly to the Site Restrictions on Gigya's site.

 

Commenting Rate Limit

Gigya supports rate limits on commenting in order to prevent spamming and abuse. This includes limiting the number of root comments and replies a user may post per stream in a day, and limiting the number of root comments and replies a user may post per site in a day.

 

Importing Commenting Systems

Gigya supports importing third-party commenting systems. If you wish to migrate to Gigya's commenting system, you can import your existing comments to Gigya and display them on your site. For this operation, please contact your Customer Services manager. 

 

Comment Stream Subscriptions and Notifications

Notification of Comments Replies

You can allow your logged-in users to get notifications when other users reply to their comments, by clicking the "Follow replies to my comments" link. Once clicked,  the user will be notified by email when someone replies to their comments (this feature is not available to anonymous commenters).
 

CommentsUI2_follow.gif

Subscribing to Comments

You can allow your users to subscribe to a comments stream by email. First make sure that in the Comments Settings page, the radio button of Display subscribe links is set to Display. This will display the RSS and Subscribe links in the Comments plugin:

CommentsUI2_subscribe.gif

 

When a user clicks the RSS button, an RSS feed reader is opened, showing the RSS feed.

 

When a user clicks the Subscribe button, the following dialog opens:

comments_subscribe_email.gif

The user will then have to enter a valid email address to get notifications on the updates on the current stream. Once the email address is entered, the Subscribe button changes to Unsubscribe, so that the user can decide to no longer receive notifications. The subscription is not immediate, Gigya checks for comment updates every few hours and notifies the user via email that comments have been added to the stream to which they have subscribed.

There are a couple of additional points you should know:

  1. Notification emails will not be sent if the same user who subscribed to the stream has visited the comment page and viewed these comments. In other words, emails will only be sent if the user has not seen the newly posted comments.
  1. Only one batch notification email will be sent at a time, regardless of how many new comments have been posted.

Note: Any user can subscribe to comments updates via email, either a logged in or a guest user. Users can unsubscribe by clicking the Unsubscribe button in the Comments plugin, or through the link in the update email. 

 

Comment Email Templates

Users who subscribe to comment streams receive a Stream Subscription Email notifying them that they have subscribed to the stream and a Comments Reply Email notifying them when someone replies to their comment.
The default form of these emails exists in all supported languages. The language of the comment stream determines which language will be used in the email. Comment email subscriptions and the languages they use can be set in comments.subscribe and comments.setUserOptions.

The default content of the notification emails can be customized by site administrators using the Comments Email Templates (Settings >> Comments >> Email Templates in the Gigya Console).
When customized templates are created, they are for a specific Comment Category and language. 

Default Stream Subscription Email

streamSubscription.png

Default Comment Reply Email

commentreply.png

Content of Email Templates

Customized email templates define email content (from, subject and body) for a specific language and comment category. The email template is an HTML template that supports placeholders and META tags.

  • META tags define the header of the email.
  • Placeholders are variables that Gigya replaces in the email body (text) with actual values when the email is sent. All email templates must contain an %unsubscribeLink% placeholder. 

 

Note: Email templates cannot be saved without an unsubscribe link (%unsubscribeLink%).

The supported META tags:

  • <META name="from" content="Comment Notification <notifications@gigya-comments.com>" /> - specifies the source of the email, i.e. what will be written in the "from" of the email.
  • <META name="subject" content="Re: %streamTitle%" /> - defines the subject of the email.

The supported placeholders for Stream Subscription Emails:

  • %unsubscribeLink% - Required.
  • %streamTitle% - Title of the comment stream, taken from the Stream object.
  • %streamURL% - URL of the comment stream, taken from the Stream object.

​​The supported placeholders for Comments Reply Emails:

  • %unsubscribeLink% - Required.
  • %streamTitle% - Title of the comment stream, taken from the Stream object.​
  • %streamURL% - URL of the comment stream, taken from the Stream object.
  • %senderName% - Name of the person who posted the comment, taken from the Sender object in the Comment object.
  • %comment% - Text of the comment, taken from the commentText field in the Comment object.
  • %commentStart% - First seven words of the comment, up to a limit of 50 characters.
  • %senderPhoto% - Picture of the person who posted the comment, taken from photoURL in the Sender object in the Comment object.
 

Creating Customized Emails

The Email Templates page has two tabs, one for the Stream Subscription Email and one for the Comments Reply Email

email-templates2.png

  • To customize the email for a particular language:
  1. Select either the Comments Reply Email tab or the Stream Subscription Email tab.
  2. Enter a comments category at the top of the page.
  3. Click the "Add Template" button.
  4. Select the language.
  5. Edit the content of the template
  6. When you finish click the "Save Settings" button. 
  •  To preview the email press the preview button comment-preview.png in the Settings column.
  • The language used for the email is set by the language of the comment stream.

UI Custom​izations

We provide several levels of customization for the Comments plugin's UI:

  • Basic customization options, through the use of the comments.showCommentsUI method parameters (see the params table in the reference page).
  • Template Classes - redefining graphic layout.
  • HTML elements style

You are welcome to consult Gigya's support team to guide you through advanced UI customizations. You can contact us by filling in a support form on our site. You can also access the support page by clicking "Support" on the upper menu of Gigya's site.

 

Template Classes

The templates parameter in comments.showCommentsUI defines a series of classes each of which represents a single user interface element in the Comments plugin. Each template is a layout definition for a group of related graphics elements in the Comments plugin and each template is sub-divided into a series of classes each of which represents an individual graphical element within that template.

Use this parameter to override the default design of the Comments plugin, to change the location of elements, prevent them from being displayed and to apply CSS to them.  The templates are: 

Comments Plugin (commentsPlugin)

Can be used to set the order in which each of the following template elements appear and whether it appears at all. Most of the commentsPlugin classes refers to one of the other templates; for example gig-comments-comments controls the comment template.

  • gig-comments-comments
  • gig-comments-composebox
  • gig-comments-header
  • gig-comments-more
  • gig-comments-updates

Header (header)

Can be used to set the order in which each class appears, whether it is displayed and to apply CSS styling.

  • gig-comments-count
  • gig-comments-header-left
  • gig-comments-rss
  • gig-comments-sort
  • gig-comments-subscribe

Updates (updates)

Can be used to control the order in which each class appears, whether it is displayed and to apply CSS styling.

  • gig-comments-updates-link
  • gig-comments-updates-text

Comment (comment)

Can be used to control the order in which each class appears, whether it is displayed and to apply CSS styling.

  • gig-comment-body
  • gig-comment-deleteLink
  • gig-comment-flag
  • gig-comment-mediaItem
  • gig-comment-photo
  • gig-comment-replies
  • gig-comment-repliesArrow
  • gig-comment-repliesArrow-text
  • gig-comment-replybox
  • gig-comment-replyLink
  • gig-comment-shareLink
  • gig-comment-status
  • gig-comment-time
  • gig-comment-title
  • gig-comment-username
  • gig-comment-viaProvider
  • gig-comment-vote-total
  • gig-comment-vote-pos
  • gig-comment-vote-neg
  • gig-comment-userBadges
  • gig-comment-commentBadges

Compose Box (composebox)

Can be used to control the order in which each class appears, whether it is displayed and to apply CSS styling.

  • gig-composebox-close
  • gig-composebox-editor
  • gig-composebox-follow
  • gig-composebox-guest-login
  • gig-composebox-logout
  • gig-composebox-media-preview
  • gig-composebox-photo
  • gig-composebox-post
  • gig-composebox-ratings
  • gig-composebox-share-providers
  • gig-composebox-site-login
  • gig-composebox-social-login
  • gig-composebox-summary-input
  • gig-composebox-title
  • gig-composebox-userBadges

My Review (myReview)

Can be used to control the order in which each class appears, whether it is displayed and to apply CSS styling.

  • gig-selfreview-body
  • gig-selfreview-body-container
  • gig-selfreview-nameAndLogout
  • gig-selfreview-ratings
  • gig-selfreview-summary
  • gig-selfreview-summary-container

 

Running Example

In the following example the Comments plugin is presented, with graphic elements laid out differently than the default.  The "Show more comments" link has been moved to the top and the header placed above the compose box.  Some of the classes in the header are not displayed.

Example Code

???<html>
<head>
<script src="http://cdn.gigya.com/JS/socialize.js?apiKey=2_Y82PzwJ_chSFImHXaIDJClnLyJzmk-VFOavSsaNTzl6m901s_NNxRAS0xJ3bd3_N" 
	type="text/javascript"></script>
</head>
<body>
<div id="commentsDiv"></div>

<script type="text/javascript">

    // Optional - define templates to changes structures in the Comments Plugin
    var templates = {
        commentsPlugin: '<span style="color:blue;">This is the more option(usually appears at the bottom):</span><span class=gig-comments-more></span><br><br><br>' +
                        '<span style="color:blue;">This is the header: </span><span class=gig-comments-header style="float:right"></span><br><br><br>' +
                        '<span style="color:blue;">This is the compose box:</span><span class=gig-comments-composebox> </span><br>' +
                        '<span style="color:blue;">This is the list of comments:</span><span class=gig-comments-comments> </span>',
                        
         header:        '<span style="color:red;">header count:</span> <span class=gig-comments-count></span><br><br>' +
                        '<span style="color:red;">header subscribe:</span><span class=gig-comments-subscribe> </span><br>',
          
    
       
        comment: '<span style="color:green;">This is the username:</span> <span class=gig-comment-username style="color:blue;"></span><br>' +
                 '<br><br><span style="color:green;">This is the Photo: </span><span class=gig-comment-photo style="float:right;"></span><br>' +
	 		       '<span style="color:green;">This is the Date String:</span> <span class=gig-comment-time style="color:blue;"></span><br>' +
                 '<span style="color:green;">This is the Comment Body:</span> <span class=gig-comment-body style="color:blue;"></span><br>' +
	 	           '<span style="color:green;">This is the Replies Count:</span> <span class=gig-comment-count style="color:blue;"></span><br>' +
                 '<span style="color:green;">This is the Reply Button: </span><span class=gig-comment-replyLink style="color:blue;"></span><br><br>' +
                 '<span style="color:green;">This is the Flagging option:</span> <span class=gig-comment-flag style="color:blue;"></span><br>' +
                 '<span style="color:green;">This is the comment vote total:</span> <span class="gig-comment-vote-total"></span><br>' +
                 '<span style="color:green;">This is the Voting option:</span> <span class=gig-comment-vote-pos style="color:blue;"></span>' +
                  '<span class=gig-comment-vote-neg style="color:blue;"></span><br>' +
                 '<span style="color:green;">This is the comment reply box:</span> <span class=gig-comment-replybox ></span><br>'

 
    }

    var params =
    {
        // Required parameters:
        categoryID: 7623701,
        containerID: 'commentsDiv',
		streamID: 'foo6', 
		version: 2,
        // Optional parameters:
        templates: templates,
        cid: ''
    }
    // Load the Comments Plugin
    gigya.comments.showCommentsUI(params);
</script>

</body>
</html>

HTML Elements Style (CSS)

Any elements on the plugin that has an ID can be overridden with supported style attributes. There are dozens of elements on the plugin. You may use Firebug to identify an HTML element on the plugin and assign a new style to it. Please make sure to use the plugin's container <div> ID when assigning style, so it will not affect other elements on the page.
For example:

<style> #commentsDiv .gig-button-post-text {color:Yellow;background-color:black} </style>

 

Sharing Comments to Social Networks

Users can share their comments to social networks by clicking the "Share" link under the comment to be shared:

CommentsUI2_share.gif

Once the "Share" link is clicked, a mini Share plugin will pop up to suggest to the user to share his comment to the social networks. The user is given an option to choose to which social network he wants to post the content. When the user presses the social network's button, Gigya will publish the user's reaction to the selected social network.

In order for this share to work, perform the following 2 easy steps: 

Step 1 - Construct a UserAction object called shareUserAction, which represents the action taken by a user on your site. The newsfeed that is published to the social networks is constructed from the fields of this object. All the fields of this object are optional. 

Step 2 - include the newly constructed shareUserAction object in the comments.showCommentsUI parameter

Step 1: Construct a UserAction Object 

The UserAction object represents a user action. We use the UserAction object constructor for this purpose:

var shareUserAction = new gigya.socialize.UserAction();

By default, the shareUserAction object fields are mapped as follows: 

  • description - the description field receives the comment text.
  • title - the title field receives the following text: "%userName commented on %pageTitle", when %userName and %pageTitle are placeholders.
  • linkBack - the linkBack field receives the URL of the page where the commenting stream is located.

After you have constructed the object, you can use the various UserAction member methods to set the rest of the object's properties, or change existing ones. For example:

shareUserAction.setSubtitle("This is my sub title");
...

The UserAction's object properties represent the various items of which a User Action may consist: Title, etc.

Step 2: Include the shareUserAction in the Comments plugin's parameters

var params =  {
    categoryID: 7623701,
    streamID: '',
    containerID: 'commentsDiv',
    version:2, 
    userAction: shareUserAction  // The UserAction object from Step 1}

 

Comments UI in Mobile View

When the comments.showCommentsUI deviceType parameter is set to mobile, the comments UI is displayed in the mobile mode. Also if deviceType is set to auto and you open the page on mobile, it will also display the mobile layout:

mobile2_comments2.gif

 

In this mobile mode some of the Comments UI functionality is not supported:

  • Flagging comments
  • Compose box side bar will be hidden, so no rich text, user tagging, media items
  • User won't be able to collapse or uncollapse the thread (hide the element)
  • Users will see the tagged user in the comments, though at this time tagging commenters is not yet supported.

When an embedded media item is in the comments stream, clicking on the HTML media item will redirect the browser to the URL.

 

Comments Counter in Share Bar

Gigya's Share Bar plugin is built out of one or more buttons, arranged horizontally in a bar. You can add a Comments button to your Share Bar, with a counter indicating the number of comments made in that specific comments stream. The comments stream is identified by its unique categoryID and streamID. To learn how to embed a Share Bar with Comments button, read the Adding a Comments Counter section of the Share Bar plugin.

 

Browsers Compatibility

Comments version 2 is supported from the following browser versions:

  • Chrome: from version 26
  • Firefox: from version 22
  • IE : from version 9
  • Safari: from version 6

For older versions the system will be automatic fallback to comments version 1.

 

Mobile Compatibility

Comments version 2 is supported from the following OS versions:

  • iOS: from version 6
  • Android: from version 4.x
  • Windows mobile: from version 8.x

Comments version 2 is supported from the following browser versions:

  • Chrome: from version 4.x
  • IE : from version 10
  • Safari: from version 7.0.4

For older versions the system will be automatic fallback to comments version 1.

 

Right-to-Left Localization

Gigya provides right-to-left language support for the comments plugin. The plugin will be displayed according to the locale:

 

CommentsUI2_rtl2.gif

 

Responsive Design

The comments plugin is designed to respond fluidly as the size of the browser window is changed. The mode can be set to Mobile or autoDetect where applicable. Read more in the Mobile View section.

 

Support for Custom Texts

The comments plugin has a long list of keys that represent texts in the plugin, for example, "thank_you_for_subscribing" represents the text "thank you for subscribing". 

You can override these existing texts, and use your own custom texts in the comments plugin. This is done with the customLang parameter in comments.showCommentsUI, by setting pairs that include the key that represents a text element in the UI, with the text to which you want to change:

customLang = {textKey1text1,textKey2text2,[...]}.

For example:

params.customLang = {
            num_comments: '%num talkbacks',
            write_a_comment: 'Write a talkback'
        }

For the full list of existing keys, please contact your account manager.

 

Search Engine Optimization (SEO) Support

This section provides instructions how to make the comments in your Comments plugin searchable by the main search engines, and by that adding SEO value to users. As you know search engines index only static data in your site. It is difficult to make them index dynamic data. This includes the comments data. The comments data is kept on Gigya's server and is requested dynamically. The search engines do not see and do not index the comments data. To solve this issue Gigya provides a static HTML format of the comments with an up-to-date content that is readable by search engines and can be indexed.

To take advantage of this, please follow the steps below:

  1. Detect the Search Engine Crawlers: Find out whether the page is viewed by a search engine spider (bot). Identify the search engine using the HTTP_USER_AGENT field. You may find a PHP example here. Customers using this code should note that customizing pages for search bots can be a violation of search engine guidelines; for more information see https://support.google.com/webmasters/answer/66355.
  2. Inject HTML Comments data: If a search engine is identified, fetch the raw comments HTML by setting the dataFormat parameter of comments.getComments to 'html':
  3. Print this HTML inside of the comments DIV container. 

Tags

This page has no custom tags.
This page has no classifications.

Comments

You must to post a comment.

Attachments