-
-
Save vfrancis/ebbec1381ca21d12dd2a to your computer and use it in GitHub Desktop.
Connections Cloud Community Customization Examples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "iFrameAppName", | |
"description": "description", | |
"type":"community_widget", | |
"urls":{ | |
"icon_url": "https://sampleconnectionswidget.mybluemix.net/icon.png", | |
"url": "https://<Connections_Cloud_URL>/connections/resources/web/com.ibm.social.urliWidget.web.resources/widget/urlWidget.xml" | |
}, | |
"payload": { | |
"defId": "iFrameAppName", | |
"showInPalette": "true", | |
"primaryWidget": "false", | |
"modes": "view", | |
"themes": "wpthemeThin wpthemeNarrow wpthemeWide wpthemeBanner", | |
"url": "https://<Connections_Cloud_URL>/connections/resources/web/com.ibm.social.urliWidget.web.resources/widget/urlWidget.xml", | |
"iconUrl": "https://sampleconnectionswidget.mybluemix.net/icon.png", | |
"itemSet": [ | |
{ | |
"value": "https://sampleconnectionswidget.mybluemix.net", | |
"name": "url" | |
}, | |
{ | |
"value": "100%", | |
"name": "width" | |
}, | |
{ | |
"value": "400px", | |
"name": "height" | |
} | |
] | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>A test frame</title> | |
<script type="text/javascript"> | |
window.onload = function() { | |
document.getElementById("host").innerHTML = location.host; | |
try { | |
window.addEventListener('message', function(evt) { | |
// In a production environment, it is recommended check event.origin to ensure the message is coming from a Connections environment. See documentation for details. | |
console.log("Got msg"); | |
console.log(evt.data); | |
document.getElementById("contextId").innerHTML = JSON.stringify(evt.data, null, 3); | |
}, false); | |
} catch (e) { | |
console.log(e); | |
} | |
parent.postMessage("appReady", "*"); | |
} | |
</script> | |
</head> | |
<body> | |
<p> | |
<h2>A test application running at <span id="host"></span>. | |
</h2> | |
</p> | |
<p> The following context is passed from Communities: </p> | |
<pre id="contextId"></pre> | |
</body> | |
</html> |
Solution is the "uniqueInstance" : "true" property..
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@BerndGewehr, i am also interested in adding widgets only once. Do you have a solution?