-
-
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> |
There is currently one possible value for mode, view
.
To make the community app (iframe app) appear in the main column in the communities overview page, set primaryWidget
to true
. When false
, it appears in the right hand column.
There are further examples here:
https://github.com/dvdsmpsn/ibm-connect-2016-examples/blob/master/community-app/
Can I prohibit widgets to be added multiple times to the same community?
Background: We have built a set of community widgets that we want to appear only once per community.
@BerndGewehr, i am also interested in adding widgets only once. Do you have a solution?
Solution is the "uniqueInstance" : "true" property..
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Can you tell me the possible values for "modes"?
I am looking for the control over where my new app can be used: right, mid, left, standalone app, if it appears in the nav dropdown or not etc.
Can you provide this information?
Thank you very much!