set content

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

set content

Bubulina
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





Take care ,
    Gabriela Radu :)
www.gabrielaradu.com


       
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: set content

Sergiu Dumitriu-2
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')")

--
Sergiu Dumitriu
http://purl.org/net/sergiu/
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: set content

Bubulina
this only adds one template..
how do i add all my templates. more than 5 in my case.

Sergiu Dumitriu <[hidden email]> 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')")

--
Sergiu Dumitriu
http://purl.org/net/sergiu/
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users






Take care ,
    Gabriela Radu :)
www.gabrielaradu.com


       
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: set content

Sergiu Dumitriu-2
Gabriela Radu wrote:

> this only adds one template..
> how do i add all my templates. more than 5 in my case.
>
> Sergiu Dumitriu <[hidden email]> 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/
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: set content

Bubulina
hmm...
it's the same problem. if i use the first idea...it does not do anything, and if i use the second one, i get to the same problem i originally had. it takes me only the last template included. :(

Sergiu Dumitriu <[hidden email]> wrote: Gabriela Radu wrote:

> this only adds one template..
> how do i add all my templates. more than 5 in my case.
>
> Sergiu Dumitriu  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/
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users






Take care ,
    Gabriela Radu :)
www.gabrielaradu.com


       
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: set content

Sergiu Dumitriu-2
Gabriela Radu wrote:
> hmm...
> it's the same problem. if i use the first idea...it does not do anything, and if i use the second one, i get to the same problem i originally had. it takes me only the last template included. :(
>

No, there shouldn't be any problem. Why do you say it does not do anything?

By the way, you DO call $mydoc.save() after setting the content, right?

> Sergiu Dumitriu <[hidden email]> wrote: Gabriela Radu wrote:
>> this only adds one template..
>> how do i add all my templates. more than 5 in my case.
>>
>> Sergiu Dumitriu  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/
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users