SocialBar
The SocialBar server controla server control uses API language to interact with the CMS and Framework UI to display the output. A server control can be dragged and dropped onto a Web form and then modified. lets users of a community website bookmark colleagues, community groups, and content.
Inserting the SocialBar server control onto a page
Prerequisite
You must have installed the server controls. See Installing server controls into Visual Studio Toolbox.
- In Visual Studio, choose View > Toolbox.
- Click the Ektron server control tab to display the server controls.
- Drag the SocialBar server control and drop it into the desired location on the page.
NOTE: You also can place the cursor on the page where you want the server control, then double click the server control that you want.
<CMS:SocialBar ID="SocialBar1" runat="server" />
- Click on
SocialBar
in the code to display and modify the control’s properties using the Properties window of Visual Studio. The page is updated as you modify the property values.
SocialBar properties
The following are Ektron-specific server controla server control uses API language to interact with the CMS and Framework UI to display the output. A server control can be dragged and dropped onto a Web form and then modified. properties. For information about native .NET properties such as font, height, width and border style, use Visual Studio® help.
- CacheInterval (Double)
The number of seconds that a server controla server control uses API language to interact with the CMS and Framework UI to display the output. A server control can be dragged and dropped onto a Web form and then modified.’s data is cached. The default is 0 (zero). For example, if you want to cache the data for 5 minutes, set to 300. See also: Caching with server controls.
- DefaultObjectID (Long)
The default object ID for this control to use when there is no matching dynamic parameter value passed. If you set this property set to 0 (zero) and leave the DynamicObjectParameter blank, the social bar can be used to add Web pages to your favorites.
- DisplayXslt (String)
If desired, enter a relative or absolute path to an Xslt that determines the display of the page.
WARNING! Files stored in the
siteroot\Workarea
folder are overwritten (or deleted) when you upgrade Ektron. To avoid problems, copy the default file to a folder outside thesiteroot\workarea
folder then edit it. If there is no default file, create the file outside thesiteroot\workarea
folder. Next, in this property, enter the path to that file relative to the site root folder. - DoInitFill (Boolean)
By default, Fill occurs during the Page_Init event. Set to false if you want to postpone the fill-action until later. In this case, Fill is automatically called during the Page Render event. You might do this if you need to set or change a property on the control in code-behind and have it render with your changes shown.
- DynamicObjectParameter (String)
Gets or sets the QueryString parameter to read a object ID dynamically. To use the default object ID, leave blank.
- Hide (Boolean)
Hides or displays the output of the control in design time and run time.
- True. Hide the control output.
- False. Display the control output.
- IncludeIcons (Boolean)
Select whether icons are displayed next to each item.
- True. Display icons next to each item.
- False. Do not display icons next to each item.
- InviteURL (String)
The URL to the Invite server control’s Web page. Two variables used within the URL.
- {0}. Object ID
- {1}. Object type
The link must have both variables. The Web form can be relative or absolute. Below is an example.
invitepage.aspx?id={0}&type={1}
- Items(String)
A comma-separated list of items that you want to appear on the Social Bar.
- Add to.
- If this control is associated with a user, the Addto item appears as:
- Add a Colleague. If you are viewing another user’s profile page and can add them as a colleague.
- CancelColleague Request. If you are viewing another user’s profile page who you asked to be a colleague but the user has not yet accepted.
- Remove From Colleagues. If you are viewing a current colleague’s profile page.
- If the control is associated with a community group, the Addto item appears as:
- Join Group. If you visit a community group that you have not joined.
- Leave Group. If you already belong to a community group.
- CancelRequest to Join. If you have tried join a restricted group and have not yet been accepted.
- If the control is associated with content, the Addto item appears as:
- Add to Favorites. If you view content that is not in your Favorites.
- Remove Favorites. If you view content that is in your Favorites.
- If this control is associated with a user, the Addto item appears as:
- Invite. A link to the Web page that contains the Invite server control. This control lets you invite people to register on the site and become a colleague.
IMPORTANT: For the Invite item to be active, you must enter a link to the page hosting the Invite control into the
InviteURL
property. - GroupInvite. Opens a dialog that invites colleagues or people who are not registered on the site to join the group.
- Email. Email this Web page. Clicking this item launches your email with the subject and body loaded with the information about the content, user or community group.
- Digg. Appears as Digg It. Launches
Digg.com
, a social bookmarking service. - Delicious. Launches
https://del.icio.us
, a social bookmarking service. - Facebook. Appears as Facebook. Launches Facebook, a social network service.
- Google. Appears as Google It. Launches Google’s social bookmarking service.
- Furl. Appears as Furl It. Launches Furl, a social bookmarking service.
- Technorati. Appears as Technorati. Launches Technorati, a social bookmarking service.
- Twitter. Launches Twitter, a social network service, which lets you communicate with other Twitter users. If the Twitter link is clicked, and you log into a Twitter account, a link to the current page is inserted into the Status box.
- Yahoo. Appears as Yahoo! It. Launches Yahoo’s social bookmarking service.
- Print. Print the Web page.
- PrivateMessageUser. Creates a link that lets you send a Private Message to a user. See also:
- PrivateMessageAdmin. Creates a link that lets you send a Private Message to a community group’s administrator. See also: .
- Add to.
- Language (Integer)
Set a language for viewing content; shows results in design-time (in Visual Studio) and at run-time (in a browser).
- MarkupLanguage (String)
Enter the template markup file (
.ekml
) that controls the display of this server control. To use the default .ekml file, leave this field blank.The default file follows this pattern:\siteroot\Workarea\template\this object\objectname.ekml
. For example,\siteroot\Workarea\template\collection\collection.ekml.
To customize the default .ekml file, copy it to a folder outside thesiteroot\workarea
folder and edit it. Next, in this property, enter the path to that file relative to the site root folder.See also: Ektron Markup LanguageEktron Markup Language - MessagingURL (String)
The Web page that hosts the Messaging server control. This property is used when either
PrivateMessageUser
orPrivateMessageAdmin
appears in the Items property.If a value appears in the
ek_RedirectFromLoginKeyName
key in theweb.config
file, the user is returned to the original URL after sending the message. By default, this value isRedirectUrl
. If you remove this value and do not add another, the person sending a message sees a note stating “Your message has been sent.” - ObjectType
The type of object to which this control is assigned. Choices are:
- Content
- User
- Group
- Data Type. Ektron.Cms.Common.EkEnumeration.CMSSocialBarTypes
- Stylesheet (String)
Specify the path to a style sheet for use with this server control. Leave blank to use the default style sheet. To use a custom style sheet, place it in a folder outside the
siteroot\workarea
folder then edit it. Next, in this property, enter the path to the custom style sheet relative to the site root folder.NOTE: If you enter a valid EkML file at the
MarkupLanguage
property, theStylesheet
property is ignored. - SuppressWrapperTags (Boolean)
Suppresses the output of the span/div tags around the control.
- True. Suppress wrap tags.
- False (default). Allow wrap tags.
- WrapTag (String)
Lets a developer specify a server control’s tag.
- Span (default). Designate an inline portion of an HTML document as a span element.
- Div. Apply attributes to a block of code.
- Custom. Lets you use a custom tag.
Using the SocialBar server control
The SocialBar server controla server control uses API language to interact with the CMS and Framework UI to display the output. A server control can be dragged and dropped onto a Web form and then modified. lets users of a community website bookmark colleagues, community groups, and content. The following table explains the details.
Item being bookmarked |
Description |
---|---|
Users |
|
Group |
|
Content |
Add or remove content and URLs from a user’s Favorites. See also: Favorites |
The Social Bar control also is used to bookmark Web pages with Social Bookmarking services, such as Digg.com or del.icio.us. By default, Digg.com and del.icio.us are loaded in the Items
property of the server control.
In addition, the Social Bar control can print or email a Web page, and invite non-site users to become members of the site. Clicking Invite links to a Web page that hosts the Invite server control. See also: Invite.
Adding a Web page URL to a favorites via the social bar
You can let users add a Web page’s URL to their Favorites when they click Add to Favorites on the Social Bar. Typically, you would do this if more than one content item appears on a Web page, but you want only one Social Bar control on the page.
- Drag and drop a SocialBar server control on a Web form.
- Set the
DefaultObjectID
property to 0 (zero). - Leave the
DynamicObjectParameter
property blank. - If it is not already there, copy the comma-separated list of items from the
Items
property to the Addto item property. - Set the
ObjectType
property to Content.
The image below shows a Web page with several content items. A Social Bar control is associated with each one. In this example, when a you click Add to Favorites, you add the associated content item to your Favorites.
In the second image, one Social Bar appears on the Web page with several content items. In this example, if you click Add to Favorites on the Social Bar, you add the Web page’s URL to your Favorites.
See also: Adding a URL to your favorites
Sending a private message from the social bar
You can send private messages to another user or the community group administrator from the Social Bar control.
- Drop a SocialBar server control on a user’s profile or community group’s page.
- Set the
ObjectType
property to User or Group. - Add either PrivateMessageUser or PrivateMessageAdmin to
Items
property.- Use
PrivateMessageUser
to let a user send a message to the user whose profile is being viewed. - Use
PrivateMessageAdmin
to let a user send a message to the group administrator.
- Use
- In the
MessagingUrl
property, identify a page that contains the Messaging server control. See also: Messaging. - Make sure the
DynamicObjectParameter
is set, if necessary.
Tweeting the current URL
You can let site visitors use Twitter to tweet their current browsing location by adding the Twitter item to the list of parameters in the SocialBar’s Items
property. After the item is added, a Twitter icon and link appear in the Social Bar. When you click the link, Twitter is launched. After you log into your Twitter account, your current browsing location appears in the “What are you doing?” status box. You then can click Twitter’s Update button to post the status.
- Drag and drop a SocialBar server control on a Web form.
- Make sure the
DefaultObjectID
property is set to 0 (zero). - Leave the
DynamicObjectParameter
property blank. - If it is not already there, add the Twitter item to the comma-separated list in the
Items
property. - Set the
ObjectType
property to Content, User or Group, depending on the type of page you are editing.