Since you only need to inject html content indeed the right approach is to use the 'content' attribute as described by denov and Manjunatha.
In that particular case also, as said by Manjunatha, you don't need the domConstruct part and maybe not the div, and finally you can provide content in the instantiation statement, so the compact form would be, :var top = new ContentPane({..., content: title});.
You can then add widgets to top by using top.addChild(aWidget) - e.g.for a menu bar, which would then appear below the content (the title). But aWidget has to be a widget, which banner is not.
Since you only need to inject html content indeed the right approach is to use the 'content' attribute as described by denov and Manjunatha.
In that particular case also, as said by Manjunatha, you don't need the domConstruct part and maybe not the div, and finally you can provide content in the instantiation statement, so the compact form would be, :
var top = new ContentPane({..., content: title});
.You can then add widgets to top by using top.addChild(aWidget) - e.g.for a menu bar, which would then appear below the content (the title). But aWidget has to be a widget, which banner is not.
take a look at this jsfiddle Initially, content for the pane is foo! bar! and on click of the button "Click" content gets changed to a Button
**
**
**
**
**
**
you have
top
define as ContentPane API. andBanner
as domNode. so to set a domNode you need to set content.if you want to add a widget (think of these as code, not HTML) to a content page you need to add it's dom.
or
if you pass a widget it must subclass dijit/_WidgetBase and you need to call startup on it.
I prefer to use a single widget per pane. i have multiple widgets wrap them up into a single widget.