HiI have a 500 lines of code which has to be used by all my tpls.(Dummy tpl file attached in the post). I want to put it in a sigle file. Please tell me what methodolgy I should use for this.I want this reusable part to be put into a single file ,could be text file or anything, so that it can be used by other tpls as well .Because I have used things like iwpt_dcr_value etc , I cant have it in a PM. Any suggestions on that? Can I use tag or some thing like whichis used in DCTs ?Thanks in advance
You might also wanna take a look at <iw_include pt="PathToYourTpl" mode="cwd"> tag.
You certainly can use PM.To do that you would have to rework your code slightly to use TeamSite:CRnode::value and TeamSite:CRnode::get_node_list in place of iwpt_dcr_value/iwpt_dcr_list and pass root DCR Node as a parameter from your PT.Some details were discussed in [thread=17335]this[/thread] thread
Hey Because of some environment related issue I cant use DCRnode. I have another idea .
Why dont I use $com="$iwhome/iw-perl/bin/iwperl $iwhome/bin/iwpt_compile.ipl -pt \"$PTpath\" -iw_pt-dcr \"$DCRpath\" 2>&1";$result = `$com` ;in all my TPLs and run the $PTpath tpl (which has the common 500 line tpl code) for all the $DCRpath dcrs.I guess this should work well. Any issues on this ?Please suggest...
$PTpath
<category name="cat_name"> <!-- ... --> <data-type name="dt_name" dcr-type="xml"> <presentation> <template name="../../common/presentation/pt_name.tpl" extension="html"> <!-- ... --> </template> </presentation> </data-type> <!-- ... --></category>
<iw_include pt="../../common/pt_name.tpl" mode="ptlocal"/>
<iw_include pt="../../common/pt_name.tpl" mode="ptlocal" dtype_param="dt_name"/>
$iw_arg{dtype}
Hey Because of some environment related issue I cant use DCRnode. I have another idea . Why dont I use $com="$iwhome/iw-perl/bin/iwperl $iwhome/bin/iwpt_compile.ipl -pt \"$PTpath\" -iw_pt-dcr \"$DCRpath\" 2>&1";$result = `$com` ;in all my TPLs and run the $PTpath tpl (which has the common 500 line tpl code) for all the $DCRpath dcrs.I guess this should work well. Any issues on this ?Please suggest...