Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
calling ipl from tpl fles
lucifer
i have written an ipl file that has a function generateURL().
i need to call this function from a tpl file . could any body help me out in this regard
Find more posts tagged with
Comments
Migrateduser
Well... this can be done. Its as simple as doing something like:
<iw_perl><![CDATA[
my $return_val = `yourperl.ipl`;
]]>
</iw_perl>
The above however is probably not what you want. You would probably be better off turning your code in the .ipl into a perl module rather than execing the perl script as a system call..
The code for that would look something closer to:
<iw_perl><![CDATA[
use MyModule;
my $return_val = MyModule::yourperl();
]]>
</iw_perl>
Keep in mind however that if your module/ipl prints out things that you want to end up in your tpl output you will need to look at the tags/modules that are provided with iw-perl for templating. and either use those in your module/ipl or have it returned so you can use iwpt_output (part of the iw_perl module)
please examine the presentation template perldocs and the faq located here for more info:
http://support.interwoven.com/library/devel/tst/pt/
Edited by nacks on 09/15/02 00:54 AM (server time).
tecthis
We call .pm files from our tpls. Basically create a perl module and place it in the PT directory under which is located at
<iw-home>/iw-perl/lib/perl5/site_perl/5.005/TeamSite/PT/
Then just call it from your tpl like this
<my_script/>
No need to add the .pm extention.
Hope this helps,
Alex...
Alexander Correaa
alex_correa@baxter.com