Domanda

I'm using a partial helper as;

{<subTemplate}
 {type}
 {minute}
 {count}
{/subTemplate}

{@partial type=type minute=minute count=count}
  {+sub_template/}
{/partial}

but as you can see for any field I want to use in my subTemplate, I need to add to the partial declaration. I tried

{@partial record=.}
  {+sub_template/}
{/partial}

but doesn't seem to work.

Any ideas?

È stato utile?

Soluzione

The documentation does not state that the base template ever gets access to the the Context. It appears that it is intended for html formatting only. Not for data. See Dust Blocks and inline partials for more info.

You could set a global context variable for use in the base template to get around this limitation. This is also described in the dust tutorial at Setting your own context.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top