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)
TPL for preview only ?
nipper
Is there a way to set up a TPL for preview only and another for generate ? Does not look like
there is a way to tell templating.cfg to use 1 for preview and another for generate.
The only option I can think of is to have 1 tpl, that figures out if it is a review or generate (how ? by
looking at output file name zz_ ?) and running iwpt_compile for the appropriate TPL.
Any better way ?
Andy
Find more posts tagged with
Comments
akshathp
In past I have done this by using the "-oprefix" flag to determine in TPL whether user clicked preview or generate.
---------------------------------------------
<iw_perl>
my $outName = iwpt_get_ofile_name();
my $dcrName = iwpt_get_dcr_name();
my $check = iwpt_get_flag_param('-oprefix');
if($check eq ''){
#Code for Generate
}
else{
#Code for Preview
}
</iw_perl>
---------------------------------------------
Akshat Pramod Sharma
JeremyH
Using iw_include with component templates may be an easier solution if they are totally different:
1) Have a master template that just checks to see if it is preview or generating (using the -oprefix would be the most fullproof way)
2) include the 'generate' template or the 'preview' template based on the action being performed.
If they are quite similar with just a few minor changes, then some conditional logic in the template may be also be a good solution.