Storified Web Part Documentation - 1000Memories/Documentation GitHub Wiki
This page explains how to implement the "storified" success message web parts for Bandido sharing. This includes the merge success message as well as the side panel success message:
For general web part implementation details including prerequisites and dependencies, see Web Part Documentation page.
- Dev: http://sharing-webpart.ajax.ancestrydev.com/webparts/share.json
- Stage: http://sharing-webpart.ajax.ancestrystage.com/webparts/share.json
- Production: http://sharing-webpart.ajax.ancestry.com/webparts/share.json
The storified web part supports two styles which can be specified using the style= query param:
-
storified-sucesss-merge(for merge success message): http://sharing-webpart.ajax.ancestry.com/webparts/share.json?style=storified-success-merge -
storified-success-small(for side panel): http://sharing-webpart.ajax.ancestry.com/webparts/share.json?style=storified-success-small
Region CSS ID can be specified using the region= GET param to allow for multiple bandido web parts on the same page. Important: region CSS IDs must be unique per page. If you have multiple web parts embedded per page (e.g. side panel) ensure that there are no conflicts with the region IDs.
The following specifies data attributes that you should add for the region <div> of the web part.
-
data-tree-idthe tree ID that the search record is attached to -
data-person-idthe person ID that the search record is attached to -
data-person-given-namethe given name of the person -
data-person-surnamethe surname of the person -
data-person-genderthe gender of the person (should bemale,female, orunknown) -
data-collection-idthe collection ID of the search record (sometimes referred to asdbid) -
data-referrer-clientfor the website, this should be "website", "website-stage", or "website-dev". For iOS this should be "ios") -
data-referrer-pagethe name of the page that this web part is being implemented on (e.g. "interactive-image-viewer", "all-hints", etc.) -
data-locale- see below for details
-
data-image-idthe image ID of the search record -
data-record-idthe record ID of the search record -
data-titlethe title of the record (e.g. "1910 U.S. Federal Census") -
data-continue-searching-url- if provided, we'll show a "Continue Searching" button with the provided URL -
data-person-default-photo-id- the image ID of the person's default photo
-
data-tree-idthe tree ID that the content is attached to -
data-person-idthe person ID that the content is attached to -
data-person-given-namethe given name of the person -
data-person-surnamethe surname of the person -
data-person-genderthe gender of the person (should bemale,female, orunknown) -
data-original-object-idthe original object ID of the user-generated content -
data-cloned-object-idthe cloned object ID of the user-generated content -
data-object-typethe type of content being shared. Should be one ofphoto,story,video, oraudio -
data-titlethe user-provided title of the content -
data-descriptionthe user-provided description of the content -
data-referrer-clientfor the website, this should be "website", "website-stage", or "website-dev". For iOS this should be "ios") -
data-referrer-pagethe name of the page that this web part is being implemented on (e.g. "interactive-image-viewer", "all-hints", etc.) -
data-locale- see below for details
-
data-continue-searching-url- if provided, we'll show a "Continue Searching" button with the provided URL -
data-person-default-photo-id- the image ID of the person's default photo
-
data-tree-idthe tree ID of the person was merged into -
data-person-idthe person ID that was merged into -
data-person-given-namethe given name of the person -
data-person-surnamethe surname of the person -
data-person-genderthe gender of the person (should bemale,female, orunknown) -
data-member-treeshould be set to the String"true" -
data-referrer-clientfor the website, this should be "website", "website-stage", or "website-dev". For iOS this should be "ios") -
data-referrer-pagethe name of the page that this web part is being implemented on (e.g. "interactive-image-viewer", "all-hints", etc.) -
data-locale- see below for details
-
data-continue-searching-url- if provided, we'll show a "Continue Searching" button with the provided URL -
data-person-default-photo-id- the image ID of the person's default photo
Specify either string or Windows codes
"en-US" : "1033"
"en-CA" : "4105"
"fr-CA" : "3084"
"en-UK" : "2057"
"sv-SE" : "1053"
"it-IT" : "1040"
"de-DE" : "1031"
"fr-FR" : "1036"
- Add a share region
<div>tag to the page as described above with all required data attributes filled out. - On document ready, call
AjaxManager.send, passingcache: true,jsonpCallback: "<insert CSS ID for the share region>"and the Bandido/Bandido+ web part endpoint URL.
-
cache: (boolean, required) should always be set totrue -
jsonpCallback: (string, required) should be set to the CSS ID of the web part region -
url: (string, required) should be set to the Bandido web part endpoint -
success,failure, andafter: (functions, optional): These callback functions will be called on success/failure of the web part view rendering. Theaftercallback will be called regardless of success or failure.
<div id='StorifiedShareRegion' data-object-id='123' data-tree-id='456' data-person-id='789'
data-referrer-client='website' data-referrer-page='AllHints'></div>
<script>
$(function() {
AjaxManager.send({
cache: true,
jsonpCallback: "StorifiedShareRegion",
url: "http://sharing-webpart.ajax.ancestry.com/webparts/share.json?style=storified-success®ion=StorifiedShareRegion"
});
});
</script>