Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
return values from an included PT
ghost
Hi there,
I'm including one PT into another, using the <iw_include> Tag.
It woks fine, but now i the need result of the included scripts in two different locations within the including script. So i'm looking for a way to pass some kind of variable or other container from the included to the including script, which i can edit there, or even better, modify with some perl and then edit there.
Thy for any hint!
G.
Find more posts tagged with
Comments
Adam Stoller
An included PT is just that - it is processed as-if the code within was actually written at the point where you included it.
If you need the same results in two different places, try including the PT twice (I doubt that's what you're looking for)
If you need different parts of the PT to be evaluated in different places, consider breaking up the included PT into two (or more) included PTs.
Alternatively - you may be able to make use of the iw_ostream buffer functionality to have the included PT refrenced once, but put its output into two (or more) buffers, and then your main PT can decide when to output those buffers.
--fish
(Interwoven Senior Technical Consultant)
ghost
> An included PT is just that - it is processed as-if the code within was actually written at the point where you included it.
thx 4 your answer, but
it doesn't seem to work exactly like that.
If i use some perl code inbetween some <iw_perl> tags in the included script and define a variable $foo there, i can't call $foo with <iw_value name="foo" /> in the main script.
Though i can do this in one and the same script. Do i have to set the variables global anyhow?
Right know i'm using $ENV{foo} to transfer variables included to including PT, but this seems pretts dirty to me.
james1
I don't know of a way for the child PT to cause side effects to variable values that the parent PT would be able to see.
In case you want to know about the reverse (passing data from parent to child), please see:
http://[your-teamsite-server]/iw/help/tst/pt/TeamSite__PT__iw_include.html
-- James
--
James H Koh
Interwoven Engineering