Getting the namespace from the Script Meta Data

Any template questions or comments or suggestions

Getting the namespace from the Script Meta Data

Postby Micklang on Thu Dec 21, 2006 5:28 am

There is a namespace field in the zeus script meta data (ie uniqueID, title NANESPACE, type, mode, template scripting engine... etc). Is there a way to access this value programatically in the script ?

Looking through the sample templates it seems these fields are never used, in particular where people want to parametrically set the namespace for generated code, everyone seems to be creating a second namespace field in the script's gui which is defaulted to a value unrelated to that set in the tab.

This seems a little confusing. Can anyone explain if/how these settings are used and in particular the namespace field?
Micklang
Lurker
 
Posts: 6
Joined: Thu Dec 21, 2006 5:12 am

Postby justin.greenwood on Thu Dec 21, 2006 9:07 pm

The template meta-data is available in the template. Here's some sample code to put in the template body of a jscript template. (it could be done in C# or VB too of course):
Code: Select all
<%= context.ExecutingTemplate.UniqueID %>
<%= context.ExecutingTemplate.Title %>
<%= context.ExecutingTemplate.NamespacePathString %>

You can find all of this info in the Zeus help file under IZeusContext.
User avatar
justin.greenwood
Site Admin
 
Posts: 441
Joined: Sat Apr 03, 2004 6:10 am
Location: Indianapolis, IN

Thanks

Postby Micklang on Fri Dec 22, 2006 8:44 am

Works!

:D
Micklang
Lurker
 
Posts: 6
Joined: Thu Dec 21, 2006 5:12 am


Return to General Template Questions/Comments

Who is online

Users browsing this forum: No registered users and 4 guests

cron