|
|
Customizing the Launchpad On-Page MenuIntroductionLaunchpad On-Page is a standalone, customizable viral sharing menu that will allow you to quickly and easily convert your Web content into portable widgets. The sharing menu allows users of your site to post the content widget to their destination of choice, such as Google, Facebook, MySpace, etc. This guide discusses many of the configuration options available for customizing the service menu, using the Launchpad On-Page APIs. Audience for this GuideThis guide is for developers who are tasked with implementing Clearspring Launchpad On-Page Share Menu with their Web content and wants to customize the look and feel of the share menu. This guide assumes that the reader is familiar with Launchpad On-Page and its APIs. To become familiar with the APIs review them at: http://www.clearspring.com/docs/tech/apis/on-page Changing the services (social networks, bookmarks, etc.) available on the menu is not covered in this guide. Please review the “Launchpad-OnPage Guide: Configuring Services“ available at: http://www.clearspring.com/docs/tech/guides Share MenuLaunchpad On-Page allows you to add the Clearspring Share Menu to any type of content that you want shared. By default the menu is fully displayed at 400px by 210px, blue user interface, etc.
The menu can be fully customizable using the Widget Console or the simple configuration API. The following sections will highlight common customizations of the menu using the configuration API. Menu SizingThe Launchpad On-Page menu defaults to 400px by 210px. In most cases this menu size works well. However in cases where the size needs to be adjusted, the Launchpad On-Page configuration API makes it simple to do so. When calling the menu methods, ShowMenu() or CreateMenu(), you can define the height and width of the menu. To define the size of the menu add the menuWidth and menuHeight values, such as: <script type="text/javascript"> The above code will give you a menu like this (actual size):
The configuration option for sizing provides significant flexibility for defining a menu that fits your needs. Share ButtonSome implementations of Launchpad On-Page may not warrant the full display of the menu. In these cases the menu can be hidden behind a share button, that when clicked will display the menu.To use the button option of the Launchpad On-Page menu you simply use the ShowButton() method, as such: <script type="text/javascript"> The above code simply display the following:
When the button is clicked the default menu will be displayed below the button. As we saw above the menu can be sized (and as we will see later in this document, customized). The following shows some example of button mode with customized menus.
When using the sharing button (either the standard button or a custom button described below) you may want to have the menu displayed else where on the page. For example, your page has images that can be shared. The sharing button is placed below each image so the user can easily see that they can grab the image. However you would prefer to place the menu to the right of the image, as to not obstruct the image below. This is easily accomplished using the targetElement configuration parameter, as shown below. <script type="text/javascript"> The value of the targetElement configuration is the value of a DIV tag. The menu will be placed within the DIV tag. In the example code above, the menu will be placed in the DIV tag with ID value “Image13-menu” when the Share button is pressed. Custom Share ButtonIf you are not fond of our buttons your do not have to use them. You can substitute our button for a custom button image, a link, or what ever. To do so you can use the CreateMenu() function, which lets you create a menu object, using the same configuration parameters you used for ShowMenu() and ShowButton(), but will not be initially visible. When you create your menu with the CreateMenu() function you will add the actionElement parameter. This parameter will be the page element, anywhere on the page, that when clicked will display the menu. The menu will be positioned relative this element. The following code provides an example for using an image as the button. <a id="getButton" href="#"><img src="starBtn.png" width="76" height="74" border="0"></a> The anchor above has an ID of getButton. This ID is the string value for the actionElement parameter. When the starBtn image is clicked the menu will be displayed below it. The following examples show the star button, from the code example above, and a simple text link. Note, you should add the CreateMenu() call after you defined the actionElement value in the page.
These images can be used directly from their URL and do not require you to download them. To uses any of these directly you would do as follows: <a id="csShareBtn" href="#"> As described above with the Share Button using the targetElement configuration parameter allows for placing the Sharing Menu anywhere on the page. The following example shows how to use the targetElement with a custom share button. <a id="getButton" href="#"> The value of the targetElement configuration is the value of a DIV tag. The menu will be placed within the DIV tag. In the example code above, the menu will be placed in the DIV tag with ID value “Image12-menu” when the button with ID value “getButton”, which is your star button, is pressed. Single Service per ButtonUsing custom sharing buttons with the ability to define single services (see “Launchpad-OnPage Guide: Configuring Services”) provides a way to give users a single click option to grab content. For example, you know that the majority of grabs for your content are posted to MySpace, Facebook and Digg. You want users to recognize that these services are supported and with a single click easily grab, but you do not want to prohibit users of other services from grabbing your content. Using custom sharing buttons and setting single services you can provide users with this experience. First you want to define your buttons: <a id="mysBtn" href="#"> The first three buttons will be used for the single service, MySpace, Facebook and Digg respectively. The last button, which is the Clearspring star (*) image, will display the full menu.
Next we will define a CreateMenu() for each button we have defined above (remember that this should be defined after the buttons). The CreateMenu() will include the actionElement for each button defined. For the first three buttons defined above (MySpace, Facebook and Digg) we will set the servicesInclude parameter. In this example we want each button to represent a single service so the value of the servicesInclude will only include the one service identifier (check out the On-Page API documentation, http://www.clearspring.com/docs/tech/apis/on-page, for a list of all the services). The final button, the Clearspring star, will display the Launchpad On-Page menu, but we will exclude the services represented by the individual buttons. To do this we use the servicesExclude parameter. The value of servicesExclude is the list of services we define as individual buttons. <script type="text/javascript"> When completed the page will include four icons for each service. When the user clicks the MySpace icon the user will be directed to “Post to MySpace Profile” screen.
Leveraging custom buttons and service configurations provides you the ability to fully customize the Launchpad On-Page experience. Defining the BookmarkWhen using the bookmark services it is important to set the URL that you want the users to be bookmarked. This is done using the bookmarkURL parameter with either ShowMenu(), CreateMenu() or ShowButton(). The value of the parameter is a string that represents the URL to be book, for example: <script type="text/javascript"> This flexibility allows for defining the bookmarkURL to any URL. There are cases where the page containing the sharing menu is not the page that should be bookmarked. For instance the page with the menu is a product demo page and the actual URL of the product is different <script type="text/javascript"> Displaying Embed on the MenuMany users are accustom to seeing the embed code when grabbing widget for their site. The Launchpad On-Page menu provides several methods of obtaining the embed code. One method is selecting the embed icon on the Popular tab, which is the first screen seen by the user. Another method is to locate embed within the All tab. Also within the All tab a user can search or use the drop down filters to locate the embed button. ![]() Alternatively you can configure the menu to display the embed code directly on the menu. This raises the level of embed code directly to the user without any additional clicking. To enable the embed code on the menu you set the embed value to true for menuConfig option. This menuConfig option can be added to showMenu(), createMenu() and showButton(). The following code shows how to use menuConfig. <script type="text/javascript"> The above code will display the following menu: ![]() The user, if desired, can easily select the copy button to grab the embed code. In addition, when this capability is enabled, the Embed tab is removed to eliminate user confusion. Customizing the Menu AppearanceThe Launchpad On-Page menu can be customized very easily. When using the Widget Console you are able to choose between four default color template for your Sharing Menu; Grey, White, Black and Blue. In addition the Widget Console allow you to fully customized the look and feel of the menu. This section will describe how to customize the look and feel of the menu from the On-Page APIs. When styling the menu via the API requires using the menuConfig setting. The following demonstrates using the customization options via the API: <script type="text/javascript"> The above customization will generate a menu that looks like the following:
The menu customization is broken down into three sections; styling, display and global. StylingThe menu provides the ability to style the look of the menu to allow you to integrate the menu with your page. The style options are as follows: style : {
The style:menubar options provides a way to style the look and feel of the menu bar, see the following screen shot:
The style:menu options provides a way to style the look and feel of the menu, see the following screen shot:
DisplayThe display configurations are the programmatic equivalent to the widget configuration in the Widget Console. To use the display configuration the options format is as follows display : {
GlobalGlobal settings are useful defining common setting across the menu. These options are defined as follows: global : {
Questions / Comments / ConcernsWe welcome and encourage all feedback in this process. |














