ExecuteTemplate question

Any template questions or comments or suggestions

ExecuteTemplate question

Postby CrankyJim on Tue Dec 20, 2005 11:19 pm

Hi all,

I'm wondering if there's an issue or a trick that I may not be aware of.

I have a \"master\" template for lack of a better description that simply checks the values of checkboxes to determine which templates to generate.

If a template is to be run, it does so under the context.ExecuteTemplate function.

My problem is that if more than one template needs to execute, I sometimes get the output object getting filled with the contents of different templates.

I've tried calling output.clear before executing any template and within each individual template I do the same thing before doing anything in the template, but regardless, as soon as I select checkboxes to execute more than one template, thats' when the corrupt output seems to happen.

Any advice??

Thanks.
CrankyJim
1st Lieutenant
 
Posts: 50
Joined: Sat Jun 05, 2004 1:53 am
Location: Abbotsford BC Canada

Postby mike.griffin on Wed Dec 21, 2005 12:04 am

Well, first there's a better way called a template 'Group'. Try this on a new template. Go to the template settings where you set the languages and such and the Type (located under Namespace) to Group, then below you can add many templates to the listbox and it will execute them for you. The only thing is you make the UI have all the variables needed for all of the tempates (which you probably already have).

Also, if you look at Justin's reply on this thread you'll find some useful information about executing templates:
http://www.mygenerationsoftware.com/php ... tetemplate
User avatar
mike.griffin
Site Admin
 
Posts: 3290
Joined: Sat Apr 03, 2004 6:10 am
Location: Indianapolis, IN


Return to General Template Questions/Comments

Who is online

Users browsing this forum: No registered users and 2 guests

cron