Share Module
The Share Module implements the ability for end users to share a link to the viewer via email, social media, or any other type of web application. For example, if a user shares on Facebook, a post containing a link to the viewer is posted to the user's Facebook profile page. Anyone with access to the user's posts can click the link to open the viewer.
Sharing options are the application types (for example, email) or the specific applications (for example, Facebook) that the user can share links with. Options are configured using the Share Module's shareOptions
property. By default, shareOptions
are configured for Facebook, Twitter, LinkedIn, Google+, and email. You can configure additional options, provided the application's API supports sharing.
In order for end users to share the viewer's URL, you must provide a means to invoke the Sharing feature. For example, you could add sharing tools, hyperlinks, or I Want To menu items. The HTML5 Viewer has two different approaches to presenting sharing options:
-
List the Options: Open a window that lists the sharing options for the user to choose from.
-
Provide Separate Options: Provide a separate tool, menu item, or hyperlink for each sharing option.
List the Options
To list the sharing options, use the ShowShareView
command, which displays the list of sharing options (the Share Module's ShareView
view). The HTML5 Viewer has a Share tool that you can add to the toolbar to run the ShowShareView
command.
The Share tool (left) lists the sharing options when clicked
Provide Separate Options
The HTML5 Viewer has a ShareOn
command that you can use to share with a specific shareOption
.
Example of a toolbar group with application-specific sharing tools
To add a sharing tool for a specific application, add a toolbar button that runs the ShareOn
command with the id
of the shareOption
as the command parameter.
Example configuration to add a button to share on a specific platform
Configuration Properties
Module
-
shareOptions
: An array of applications to share the viewer's URL with. Each item has the following properties:-
id
: The ID of the application to share with. The ID must be unique across all of theshareOptions
. -
displayName
: The name that displays in theShareView
view's list of sharing options. -
url
: The public URL that an application provides for sharing URLs. Theurl
contains a placeholder,{ViewerUrl}
, which is replaced at run time with the viewer's URL. The SharingLink Module is responsible for creating the URL that replaces{ViewerUrl}
. For information, see SharingLink Module. -
iconUri
: The relative URI of the image to show next todisplayName
inShareView
.
-
Views
-
ShareView
: Noconfiguration
properties
View Models
-
ShareViewModel
:-
shareOptionsIds
: An array of theshareOptions
to display inShareView
. If you omitshareOptionsIds
, all the configuredshareOptions
are listed inShareView
.
-