I’m writing a dynamic content macro for confluence with atlassian connect. At the moment I’m simply trying to get a proof of concept where I insert some inline text into the flow of a page but I can’t get it to display inline - the content is always displayed as a block.
Here are distilled versions of my addon descriptor and macro page:
atlassian-connect.json:
{
"name": "Hello World",
"description": "Test Add-on",
"key": "com.example.test",
"baseUrl": "https://www.example.com",
"vendor": {
"name": "Example Ltd.",
"url": "http://www.example.com"
},
"authentication": {
"type": "none"
},
"modules": {
"dynamicContentMacros": [
{
"key": "hello-world",
"name": {
"value": "Hello Word"
},
"url": "/test.html",
"description": {
"value": "Link to stuff"
},
"outputType": "INLINE",
"bodyType": "none"
}
]
}
}
test.html
<!DOCTYPE html>
<html>
<head>
<title>Testing</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<link rel="stylesheet" href="//aui-cdn.atlassian.com/aui-adg/6.0.6/css/aui.min.css" media="all">
<link rel="stylesheet" href="//aui-cdn.atlassian.com/aui-adg/6.0.6/css/aui-experimental.min.css" media="all">
<script src="//aui-cdn.atlassian.com/aui-adg/6.0.6/js/aui.min.js"></script>
<script src="//aui-cdn.atlassian.com/aui-adg/6.0.6/js/aui-experimental.min.js"></script>
<script src="//aui-cdn.atlassian.com/aui-adg/6.0.6/js/aui-datepicker.min.js"></script>
<script src="//aui-cdn.atlassian.com/aui-adg/6.0.6/js/aui-soy.min.js"></script>
<script data-options='base: false; margin: false; resize: false'>
(function() {
var getUrlParam = function (param) {
var codedParam = (new RegExp(param + '=([^&]+)')).exec(window.location.search)[1];
return decodeURIComponent(codedParam);
};
var baseUrl = getUrlParam('xdm_e') + getUrlParam('cp');
$.getScript(baseUrl + '/atlassian-connect/all.js', function() {
console.log("I can use AP now");
});
})();
</script>
</head>
<body>
<span id="content" class='ac-content'>Hello, world!
</span>
</body>
</html>
Thanks in advance
Lewis