title: Wagtail - how to access StructBlock class attribute inside block
body: <p>I'm trying to override my block template as described here:</p>
  
  <p><a href="https://github.com/wagtail/wagtail/issues/3857" rel="nofollow noreferrer">https://github.com/wagtail/wagtail/issues/3857</a></p>
  
  <p>I added a BooleanBlock inside the class and tried to use that value to change the template but I get an error "no attribute found".</p>
  
  <pre><code>class Features_Block(StructBlock):
      title = CharBlock()
      description = TextBlock(required=False)
  
      use_other_template = BooleanBlock(default=False, required=False)
  
      class Meta:
          icon = 'list-ul'
  
      def get_template(self, context=None):
          if self.use_other_template:
              return 'other_template.html'
  
          return 'original_template.html'
  </code></pre>
  
  <p>I have found this thread which might be the answer but I don't understand how to implement it for my case:</p>
  
  <p><a href="https://github.com/wagtail/wagtail/issues/4387" rel="nofollow noreferrer">https://github.com/wagtail/wagtail/issues/4387</a></p>