Skip to content

Instantly share code, notes, and snippets.

@vfrancis
Last active December 5, 2017 15:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save vfrancis/ebbec1381ca21d12dd2a to your computer and use it in GitHub Desktop.
Save vfrancis/ebbec1381ca21d12dd2a to your computer and use it in GitHub Desktop.
Connections Cloud Community Customization Examples
{
"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"
}
]
}
}
<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>
@bgewehr
Copy link

bgewehr commented Mar 3, 2016

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!

@dvdsmpsn
Copy link

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.

@dvdsmpsn
Copy link

dvdsmpsn commented Aug 8, 2016

@BerndGewehr
Copy link

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.

@ChristianLuxem
Copy link

@BerndGewehr, i am also interested in adding widgets only once. Do you have a solution?

@ChristianLuxem
Copy link

Solution is the "uniqueInstance" : "true" property..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment