Tests whether two sites are in the same sharing group.
Class Name |
|
---|---|
Component |
|
Required Input Parameters
otherSiteId
The site to test with the siteId
-specified site.
Optional Input Parameters
siteId
The site to test with the otherSiteID
-specified site. If omitted, SitesShareShareableDroplet uses the current site.
shareableTypeId
T ShareableType of the sharing group to query. If this parameter is null, SitesShareShareableDroplet uses the value configured in its ShareableType
property.
Output Parameters
true
Rendered if the sites are in the same sharing group.
false
Rendered if the sites are not in the same sharing group.
error
Rendered if an error occurs.
errorMessage
If an error occurs, set to the error message.
Usage Notes
Given two site IDs and a ShareableType that identifies a sharing group, SitesShareShareableDroplet tests whether the two sites are members of that group. For example, before changing the site context on a given page, you might first want to check whether the current site and new site share the same shopping cart.
If no value is supplied for the input parameter siteId
, the current site is used. If the same ShareableType is tested on multiple pages, you can configure a default ShareableType for this servlet bean.
To get all sites within the same sharing group, use SharingSitesDroplet.
Example
The following example tests whether the current site and rcSite
share the same shopping cart:
<dsp:droplet name="SitesShareShareableDroplet"> <dsp:param name="shareableId" value="ShoppingCart"/> <dsp:param name="otherSiteId" value="rcSite"/> <dsp:oparam name="true"> The current site shares a shopping cart with Really Cool Site\! </dsp:oparam> <dsp:oparam name="false"> The current site doesn't share a shopping cart with Really Cool Site\! </dsp:oparam> <dsp:oparam name="error"> Only called if the SiteGroupManager isn't set. The following error occured: <dsp:valueof param="errorMessage"/> </dsp:oparam> </dsp:droplet>