Loading Pluck Applications
Load the Pluck Libraries on the page. Give your site access to the applications on the Pluck Application Server by including the following somewhere in the <head> tag:
plckForumPostItemsPerPage are some of the parameters that specify what displays in the Forums app.
- elem — This adds a wrapper element around the app. This parameter takes a string only. You can select any from existing DOM element, but DIV is recommended. If this is not defined, Pluck does a
document.writeof one for you.
- pendingClass — Specifies a class to apply to the container element while widget is loading. You can apply a throbber image as a background to this and/or block off certain amount of space in the page. This class is removed after the widget is done loading. The default class is
- completeClass — Specifies a class to apply to the container element when the widget is loaded. The default class is
- forceDelayTimeout — Specifies a time to delay the display of the app. The default is 0 (no delay).
A sample call including the global options might look like this:
This is the preferred way to call apps from the Pluck Application Server, but in some circumstances you may need to use the older way with <PAS> tags.
To use PAS tags, you must:
Set the XML Namespace. In the <HTML> tag on each page you’re installing the Pluck app, set the XML namespace for Pluck’s Social Application Server:
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:pas="http://www.yourdomain.com/2009/pluckApplicationServer">
Load the Pluck Libraries. Give your site access to the applications on the Pluck Application Server by including the following somewhere in the <head> tag:
Add the Pluck application to the page. Pluck applications can be placed on the page using specially namespaced tags (That’s why we set the XML namespace in the <HTML> tag). The XHTML tags look like:
appnamespecifies the Pluck app you’re calling (forums, persona, comments, etc.) and
parametersare the app specific parameters for that app.
For example if you want to place the Pluck Comments application it might look like this:
<pas:pluck_comments plckCommentOnKeyType="article" plckCommentOnKey="12345"></pas:pluck_comments>
plckCommentOnKeyTypespecifies what kind of content the comments belong to—In this case, they belong to an article— and
plckCommentOnKeyis the unique number identifying the parent content. This allows the Pluck Application Server to return the correct set of comments.
Be sure to use open tags and close tags for the
pas tags. The page may have problems rendering if you use self-closing tags (i.e.,
<pas:pluck_comments />). Instead, use the full tag name (include the colon and attribute after it) in both the open and close tag, like this:
ExternalResource (Article) keys uniquely identify the parent of a comment stream, reviews, recommendations, or other reactions throughout its lifetime and can not be changed. If your CMS changes the ID of an article, product, or other item you’ve placed a Pluck reaction on, you must create a mapping between the Pluck ExternalResource key and your new ID value.