loading table of contents...

Frontend Developer Manual / Version 2310

Table Of Contents

6.5.6 Elastic Social (es)

The Elastic Social FreeMarker API provides utility functions to enrich components with personal data. It uses the namespace lc for template calls. For more information see Section 6.3, “Elastic Social” in Blueprint Developer Manual .


Adds user specific data to components and function calls about users which there are complaints. It uses the namespace es for template calls.

Parameter Required Description
value Returns the complain value if true.
id The HTML id prefix for this component.
collection The name of collection.
itemId The name of itemId.
navigationId The name of navigationId.
customClass The name of customClass. Defaults to empty.

Table 6.57. Parameters of complaining

                 value=es.hasComplaintForCurrentUser(, "users")

Example 6.46. Enrich user specific data to component


Gets the Elastic Social configuration of a page. In general this is the root page of a site. Please check the CMS Javadoc for all available properties of ElasticSocialConfiguration.

Parameter Required Description
page The page to get the configuration for.

Table 6.58. Parameter of getElasticSocialConfiguration

<#assign elasticSocialConfiguration=es.getElasticSocialConfiguration(cmpage)/>
<#if elasticSocialConfiguration.isFeedbackEnabled()!false>

Example 6.47. Checks if Elastic Social is enabled


Checks page setting for Elastic Social Webflow login form.

<@cm.include self=es.getLogin()!cm.UNDEFINED view="asButtonGroup"/>

Checks if the current user of the web page is a logged-in user or it is an anonymous user. Returns to true if the current user is not logged in.

<#if es.isAnonymousUser()>...</#if>

Checks if the user choose not to publish its user name, profile image, and other personal information with its contributions. Returns to true if the user wants to remain anonymous.

Parameter Required Description
communityUser The user to be checked.

Table 6.59. Parameter of isAnonymous

<#if es.isAnonymous(>...</#if>

Returns the tenant of the current Thread. Throws Tenant Exception when no tenant has been set.

<#assign tenant=es.getCurrentTenant()/>
<#assign myUrl=cm.getLink('/signin/example_' + tenant)/>
<form action="${myUrl!""}" method="post">

Example 6.48. Sets the form action


Returns the written review of the user for a given bean.

Parameter Required Description
target The given bean.

Table 6.60. Parameter of hasUserWrittenReview


Returns the preview or live rendering depending on the state of the current user.

Parameter Required Description
review Attributing a target with text, title and rating from an author.

Table 6.61. Parameter of getReviewView

<#assign reviewView=es.getReviewView(self)/>
<#if ["default", "undecided", "rejected"]?seq_contains(reviewView)>

Example 6.49. Specified value rendering


Returns the rating score for the given community user and for a given bean.

Parameter Required Description
target The given bean.

Table 6.62. Parameter of hasUserRated


Returns the preview or live rendering depending on the state of the current user.

Parameter Required Description
comment Attributing a target with text from an author.

Table 6.63. Parameter of getCommentView

<#assign commentView=es.getCommentView(self)/>
<#if ["default", "undecided", "rejected"]?seq_contains(commentView)>

Example 6.50. Specified value rendering


Returns 5.


Returns 5.

Search Results

Table Of Contents

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.