customizing widget.

Hi,

Appreciate if anyone can help us around.

1) We are trying to integrate Comments functionality with our widget. Since the comments are part of the Popup, we are using JavaScript to create / get comments. We did the following steps:

1. Implemented "ICommentableContentType" interface

2. We used REST API call to create new comment. Please find the following code fragement.

jQuery.telligent.evolution.post({

url: jQuery.telligent.evolution.site.getBaseUrl() + 'api.ashx/v2/comments.json',

data: {

ContentId: contentId,

ContentTypeId: contentTypeId,

Body: bodyStr

},

success: function (response) {

refreshComments(contentId, contentTypeId);

}

});

The above call always throwing the following error message:

"Can not read comment

Can not create comment"

Also we need to implement the same comments functionality against each image of the image gallery (custom image gallery widget). Do we need to implement "ICommentableContentType" interface for Image type too?

2) When we are integrating the "Like" functionality with our widget, we got the following exception.

he following errors occurred:

The content with ID 6be38265-991b-483f-8bb6-5764b8355db3, does not exist. The content cannot be liked.

Unable to create Like

We use the following code fragment to add "Like"

var onLike = function (contentId, contentTypeId, typeId, complete) {

// alert("On Like");

var data = {

ContentId: contentId,

ContentTypeId: contentTypeId

};

if (typeId !== null && typeId.length > 0) {

data.TypeId = typeId;

}

$.telligent.evolution.post({

url: j.telligent.evolution.site.getBaseUrl() + 'api.ashx/v2/likes.json',

data: data,

cache: false,

dataType: 'json',

success: function (response) {

// alert("On Like: " + response);

// getCurrentCount(contentId, contentTypeId, typeId, complete);

}

});

}

We also tried to use span element with class "ui-like", this always asking for "LikeTypeId", we don't have any clue or documentation detailing the same.

  • I appologize for the confusion and I'll try to help.

    george.s
    The above call always throwing the following error message

    When you created your ICommentableCommentType plugin, did you deploy that to your web site and enable it in Plugin Manager in the Control Panel? It needs to be enabled before you can comment on content.

    george.s
    Also we need to implement the same comments functionality against each image of the image gallery (custom image gallery widget). Do we need to implement "ICommentableContentType" interface for Image type too?

    Yes, your custom image type will also need to identify itself as commentable.

    george.s
    The content with ID 6be38265-991b-483f-8bb6-5764b8355db3, does not exist. The content cannot be liked.

    When attempting to like, the like service will check that the content type exists (by retrieving the enabled plugin type referencing the defined content type ID), then query the content type to attempt to retrieve the content by it's ID (what you provided above). If the content type couldn't be found (the plugin isn't installed or enabled) or the plugin can't retrieve the content by its ID, this error will be produced.

    george.s
    We also tried to use span element with class "ui-like", this always asking for "LikeTypeId", we don't have any clue or documentation detailing the same.

    LIkeTypeId is a bit confusing and I apologize for that (I'll take the responsibility for its naming). Most core services support faceting/categorization via custom TypeIds. The primary like would always have a null/empty like type ID.  If you wanted to like the content for another reason (for example, "Recommend to others" or "I would buy again"), you could use a TypeId to categorize these variations on liking the same content.  The TypeId is not registered -- it's a special value that the UI or external service knows about for categorization purposes only.

    For most uses, the TypeId (not to be confused with ContentTypeId) is not required/necessary.

Related