質問

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?

役に立ちましたか?

解決

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.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top