Gabriela Radu wrote:
this only adds one template.. how do i add all my templates. more than 5 in my case.
Sergiu Dumitriu <[email protected]> wrote: Gabriela Radu wrote:
hello. is it possible to set content into a page , with code that comes from different templates? for example: treeheader, treepanelleft, treepanelright
$mydoc.setContent('#template("treeheader.vm")') $mydoc.setContent('#template("treepanelleft.vm")')
this does not work. it takes only my last template. i know i can just put the all templates in one template and then include that template. but i don;t want to do that and i want to include all the templates one by one. do you know a way to do this? thx
setContent is a setter, not an adder. Try:
$mydoc.setContent("${mydoc.getContent()}#template('treepanelleft.vm')")
If you already know the templates, just do: $mydoc.setContent("#template('template1.vm')#template('template2.vm')#template('template3.vm')#template('template4.vm')#template('template5.vm')") Otherwise, just repeat the previous statement as many times as you want: $mydoc.setContent("${mydoc.getContent()}#template('template1.vm')") $mydoc.setContent("${mydoc.getContent()}#template('template2.vm')") ... $mydoc.setContent("${mydoc.getContent()}#template('template5.vm')") -- Sergiu Dumitriu http://purl.org/net/sergiu/