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)
Output file extension in templating.cfg
Gopi
Hi All,
We are having a single tpl, using that want to generate two type of files (asp or htm).In templaing.cfg "extension" attribute accepts only a single value.
Requirement is, we should have only one datatype and inside that one tpl. This tpl should allow the user to save either as ".asp" or ".htm" file.
Not sure how to achieve this. Any form of information will be apprreciated.
Thanks
Gops
Find more posts tagged with
Comments
Adam Stoller
If you are trying to generate one-or-the-other via the GUI - then you will need two PTs - one for generating files with one extension and one for generating files with the other extension. Alternatively, you can use a custom menu item, cgi-callout on the DCT form, or a cgitask or externaltask within a workflow that uses iwpt_compile.ipl rather than iwgen - (iwgen looks up information about the DCT and PT in the templating.cfg file, iwpt_compile.ipl does not do so, it also does not set the TeamSite EAs on the generated files that identify them as such - so you'd have to do that yourself.
If you are trying to generate *both* - either via the GUI or through one of the alternative methods mentioned above - you can either use basic Perl I/O or the iwostream function within the PT such that the argument you provide for generation on the command line for iwgen (or iwpt_compile.ipl) has the same extension as the one listed in templating.cfg and the other output file (with the other extension, not mentioned in templating.cfg) is generated as secondary output via the I/O or iwostream function. Again, the secondary output file will not automatically have the TeamSite EAs associated with it - so you'll have to do that yourself.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Gopi
Hi,
Thanks, as said we need two types of output files (htm, asp). Both will be created manually by users. Taking this, we thought not to have copy of the tpl, because it will be difficult to maintain 2versions. For example, if something got changed in one.tpl then we have to update the same in two.tpl.
Can we think of having a includes. Example, having a main.tpl which has all the codes. But in one.tpl and two.tpl, can we simply include main.tpl. By this we will end up in maintaining only the main.tpl, though one.tpl will be used to save as "htm" and two.tpl will be used to save as "asp".
Not sure, will this create any other problem. What you suggest?.
Thanks in advance
Gops
Adam Stoller
That should work - because the included PT is not listed in templating.cfg - only the "including" PTs will be listed - so you could have a "genhtm.tpl" and "genasp.tpl" and have both of those files do an
<iw_include pt="gen_asp_or_htm.tpl" mode="ptlocal"/>
And that should accomplish what you're looking for (if I'm understanding the situation correctly now.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Gopi
Thanks again, belive this will not create any issues when we migrate from TS5.5 to TS6.x.
Thanks
Gopi