No conditional import - Subtemplate
You cannot do the conditional import of sub-template.
Import them and call them conditionally
Create a rtf called MAIN.rtf
paste the follwoing.
<?import:file:///C:/OraFusion/subtemplate1.rtf?>
<?import:file:///C:/OraFusion/subtemplate2.rtf?>
<?call@inlines:template1?><?with-param:p_template1;string(‘Call template 1 RTF’)?> <?end call?>
<?call@inlines:template2?>
<?with-param:p_template2;string('call Template 2 RTF')?> <?end call?>
<?if:1>0?>
<?call@inlines:template1?><?with-param:p_template1;string(‘Yes, 1 is greater than 0’)?> <?end call?>
<?end if?>
<?if:1>1?> <?call@inlines:template2?>
<?with-param:p_template2;string('call Template 2 RTF')?> <?end call?>
<?end if?>
The above condition fails, so template2 is not called
Create a rtf called subtemplate2
paste the following
<?template:template2?>
<?param:p_template2;string('sub template 2 rtf called')?>
<?$p_template2?><?end template2?>
create a rtf called subtemplate1
and paste the following
<?template:template1?>
<?param:p_template1;string('sub template 1 rtfcalled')?>
<?$p_template1?>
<?end template1?>
, place the subtemplate1 and subtemplate2 in the c:/Orafusion, or your own directory structure.
Note, this is being referred in the MAIN.rtf as the first statement.
Call them conditionally, but import them all...
Its like C program where you declare the header file in
<#include io.h>
<#include stdlib.h>
and then you may or may not use the functions declared inside these headers.
Import them and call them conditionally
Create a rtf called MAIN.rtf
paste the follwoing.
<?import:file:///C:/OraFusion/subtemplate1.rtf?>
<?import:file:///C:/OraFusion/subtemplate2.rtf?>
<?call@inlines:template1?><?with-param:p_template1;string(‘Call template 1 RTF’)?> <?end call?>
<?call@inlines:template2?>
<?with-param:p_template2;string('call Template 2 RTF')?> <?end call?>
<?if:1>0?>
<?call@inlines:template1?><?with-param:p_template1;string(‘Yes, 1 is greater than 0’)?> <?end call?>
<?end if?>
<?if:1>1?> <?call@inlines:template2?>
<?with-param:p_template2;string('call Template 2 RTF')?> <?end call?>
<?end if?>
The above condition fails, so template2 is not called
Create a rtf called subtemplate2
paste the following
<?template:template2?>
<?param:p_template2;string('sub template 2 rtf called')?>
<?$p_template2?><?end template2?>
create a rtf called subtemplate1
and paste the following
<?template:template1?>
<?param:p_template1;string('sub template 1 rtfcalled')?>
<?$p_template1?>
<?end template1?>
, place the subtemplate1 and subtemplate2 in the c:/Orafusion, or your own directory structure.
Note, this is being referred in the MAIN.rtf as the first statement.
Call them conditionally, but import them all...
Its like C program where you declare the header file in
<#include io.h>
<#include stdlib.h>
and then you may or may not use the functions declared inside these headers.
Comments
I will give this a shot. I couldn't get to your blog from work b/c they have it blocked so I had to check it out on lunch.
Thanks for the info!!!
Rob
I tried this but changed the import statement and it didn't work for me.
I basically want to call template1 if they enter something for parameter1. Otherwise, if they enter info in parameter2, it will call template2.
It completes with a warning each time. Any help would be great - thanks!
Rob
remove ads from your page.