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)
Generate HTML kick off script
ChuckM
We are trying to figure out if we can do the following...
When a user hits the generate HTML button, is it possible to generate the page then kick off a script which generates an additional "printer friendly" page?
Has anyone done something similar?
Find more posts tagged with
Comments
Michael
In a <iw_perl> tag you should be able to kick off any script you like. I don't know if this is the best approach though...
Jeremy
In the main tpl file you can use iwpt_compile to create the output of another file using another tpl.
So in the tpl that generates your main HTML page you have a <iw_perl> block and use iwpt_compile passing it all the required parameters to generate the extra page.
Hope that helps.
Jens
In your TPL you can also use
<iw_ostream file='PATH_TO_PRINTER_FRIENDLY_VERSION'>
HTML - printer-friendly-code
</iw_ostream>
megamala
Here is our code to generate or regenerate the Printerfriendly.html.
<iw_perl>
<![CDATA[
$printerfriendlyFileName=iwpt_get_ofile_name('dirname').'/printerfriendly.html';
$printerfriendlyFileName=~s/\/\.iwmnt//g;
#iwpt_output("File Name = $printerfriendlyFileName\n");
if (-e $printerfriendlyFileName) {
$theCommand='/local/interwoven/iw-home/bin/iwextattr -s TeamSite/Templating/PrimaryPT=Printer_Friendly.tpl '.$printerfriendlyFileName;
open(GENHDR,"|$theCommand");
close(GENHDR);
$theCommand='/local/interwoven/iw-home/bin/iwregen '.$printerfriendlyFileName;
open(GENHDR,"|$theCommand");
close(GENHDR);
}
else {
$tplNameWithPath=iwpt_get_pt_name('dirname').'/Printer_Friendly.tpl';
$tplNameWithPath=~s/\/\.iwmnt//g;
#iwpt_output("TPL Name = $tplNameWithPath\n");
$newDCRWithPath=iwpt_get_dcr_name();
$newDCRWithPath=~s/\/\.iwmnt//g;
#iwpt_output("DCR Name = $newDCRWithPath\n");
if ((-e $tplNameWithPath) && (-e $newDCRWithPath)) {
$theCommand='/local/interwoven/iw-home/bin/iwgen -t '.$tplNameWithPath.' -r '.$newDCRWithPath.' '.$printerfriendlyFileName;
#iwpt_output("the command = $theCommand\n");
open(GENHDR,"|$theCommand");
close(GENHDR);
}
}
]]>
</iw_perl>
Thanks in Advance
MM Guptha