Stream.renderRatingsReviewsWidget
From Social ID Developers
(Difference between revisions)
Ramon.maciel (Talk | contribs) (Created page with "== Description == Renders the Ratings & Reviews Widget within a DOM element. == Usage == stream.renderRatingsReviewsWidget(containerId, options) == Parameters == {| ! a...") |
Ramon.maciel (Talk | contribs) (→Parameters) |
||
(4 intermediate revisions by one user not shown) | |||
Line 17: | Line 17: | ||
| width="200px" | optional | | width="200px" | optional | ||
| object containing additional parameters. | | object containing additional parameters. | ||
+ | |+ | ||
+ | ! align="left" width="200px" style="padding-left: 20px" | loginProviders | ||
+ | | width="200px" | optional | ||
+ | | array of providers to use for login. Default: []. | ||
+ | |+ | ||
+ | ! align="left" width="200px" style="padding-left: 20px" | shareProviders | ||
+ | | width="200px" | optional | ||
+ | | array of providers to use for share. Default: use login providers. | ||
+ | |+ | ||
+ | ! align="left" width="200px" style="padding-left: 20px" | language | ||
+ | | width="200px" | optional | ||
+ | | string identifying which language to use. Options: "en" for English and "pt_br" for Brazilian Portuguese. Default: "en". | ||
|+ | |+ | ||
! align="left" width="200px" style="padding-left: 20px" | loadCss | ! align="left" width="200px" style="padding-left: 20px" | loadCss | ||
Line 26: | Line 38: | ||
| URL of an alternative CSS file to be loaded. Default: default theme CSS file. | | URL of an alternative CSS file to be loaded. Default: default theme CSS file. | ||
|+ | |+ | ||
− | ! align="left" width="200px" style="padding-left: 20px" | | + | ! align="left" width="200px" style="padding-left: 20px" | readOnly |
| width="200px" | optional | | width="200px" | optional | ||
| boolean indicating if the widget should not render post creation UI. Default: false. | | boolean indicating if the widget should not render post creation UI. Default: false. | ||
|+ | |+ | ||
− | ! align="left" width="200px" style="padding-left: 20px" | | + | ! align="left" width="200px" style="padding-left: 20px" | createOnly |
| width="200px" | optional | | width="200px" | optional | ||
| boolean indicating if the widget should not render post list UI. Default: false. | | boolean indicating if the widget should not render post list UI. Default: false. | ||
|+ | |+ | ||
− | ! align="left" width="200px" style="padding-left: 20px" | | + | ! align="left" width="200px" style="padding-left: 20px" | starLabels |
+ | | width="200px" | optional | ||
+ | | array of labels to use for each rating, from zero to 5, where zero is no rating selected. Default: ["", "Awful", "Bad", "Fair", "Good", "Great"]. | ||
+ | |+ | ||
+ | ! align="left" width="200px" style="padding-left: 20px" | showTitle | ||
| width="200px" | optional | | width="200px" | optional | ||
− | | | + | | boolean indicating if a title should be shown above the widget. Default: true. |
|+ | |+ | ||
! align="left" width="200px" style="padding-left: 20px" | required | ! align="left" width="200px" style="padding-left: 20px" | required | ||
Line 49: | Line 65: | ||
socialid.login.init(134, {loginType: "event"}); | socialid.login.init(134, {loginType: "event"}); | ||
var stream = socialid.comments.getStream(2, "streamIdentifier"); | var stream = socialid.comments.getStream(2, "streamIdentifier"); | ||
− | stream. | + | stream.renderRatingsReviewsWidget("comments-container", { |
− | + | loginProviders: ["facebook", "gplus", "twitter", "linkedin"] | |
}); | }); |
Latest revision as of 13:13, 16 June 2016
Contents |
Description
Renders the Ratings & Reviews Widget within a DOM element.
Usage
stream.renderRatingsReviewsWidget(containerId, options)
Parameters
containerId | required | Id of the DOM element where the widget will be inserted. | options | optional | object containing additional parameters. | loginProviders | optional | array of providers to use for login. Default: []. | shareProviders | optional | array of providers to use for share. Default: use login providers. | language | optional | string identifying which language to use. Options: "en" for English and "pt_br" for Brazilian Portuguese. Default: "en". | loadCss | optional | boolean indicating if the widget should load a CSS file. Default: true. | cssUrl | optional | URL of an alternative CSS file to be loaded. Default: default theme CSS file. | readOnly | optional | boolean indicating if the widget should not render post creation UI. Default: false. | createOnly | optional | boolean indicating if the widget should not render post list UI. Default: false. | starLabels | optional | array of labels to use for each rating, from zero to 5, where zero is no rating selected. Default: ["", "Awful", "Bad", "Fair", "Good", "Great"]. | showTitle | optional | boolean indicating if a title should be shown above the widget. Default: true. | required | optional | array of required post creation fields. Default: requires at least one of the fields to not be empty. |
---|
Example
It renders the Ratings & Reviews Widget within the "comments-container" with Facebook, Twitter, LinkedIn and Google+ available to login:
socialid.login.init(134, {loginType: "event"}); var stream = socialid.comments.getStream(2, "streamIdentifier"); stream.renderRatingsReviewsWidget("comments-container", { loginProviders: ["facebook", "gplus", "twitter", "linkedin"] });