[stringtemplate-interest] Question about using a separate Group file from within a group

Terence Parr parrt at cs.usfca.edu
Tue Jul 22 13:10:08 PDT 2008


On Jul 16, 2008, at 3:02 AM, Richard Martin wrote:

> Hello, I don't think that title is a very good overview so I will  
> try here.
>
> I have an inheritance tree for my pages such as
>
> Folder called siteA contains siteA templates such as :
> Base.stg - outline of page that uses regions to fill in gaps
> Page1.stg that extends Base.  - defines the missing bits in the  
> middle.
> Page2.stg that extends Base.  - same as 1 but with different things.
>
> With multiple sites and pages I want to be able to call another
> template group, generic.stg.  Doesn't need an inheritance tree.  So I
> can go like this from inside an overriding region on page1 -
> $doSomethingGeneric(paramA, paramB, paramC)$ and have it call a
> template method from generic.stg.
>
> I have loaded the generic folder and the site folder into a
> templateGroupLoader.  Is it possible for me to call template methods
> on generic from within a page template group?

I Don't really have good "scoping" syntax yet so you can refer to  
templates in lots of different groups. Perhaps create a super group  
that contains all of your generic stuff?

Ter


More information about the stringtemplate-interest mailing list