1
votes

Is it possible to access UI.contentBlock from within a template helper?

For instance, given the following template:

<template name="select">
  <ul class="select">
    {{optionsToListElements}}
  </ul>
  <select>
    {{> UI.contentBlock}}
  </select>
</template>

Is there any way to pass UI.contentBlock into the template helper optionsToListElements? I've tried passing it directly as in {{optionsToListElements UI.contentBlock}} and as a named variable, {{optionsToListElements contentBlock=UI.contentBlock}}, and just trying to access it from the helper without passing it at all, but none of those seems to work.

1
After reading the docs on UI.contentBlock I realized I was way off so I removed my answer. - Michel Floyd
@Michel Thanks for taking a look! - Eric

1 Answers

0
votes

You should be able to access the content block inside the helper using Template.instance().$('select')