Search code examples
tapestry

Is there a way to add mixins to the usage of <body /> inside a component


Consider a component say Article used in a tml file as follows:

<t:article id="id">
    <t:contols model="articleControls" />
</t:article>

The tml of the Article component is say as follows:

<article class="app-some-wrapper-class">
  <h2>${title}</h2>
  <h3>${subtile}</h3>
  <body t:mixins="decorator" decorator="shadow" /> <!-- note the use of a mixin here -->
</article>

I need to apply the mixin to the <body/> parameter, but this implementation will throw an ApplicationExpection. What is the correct way or alternate way to do this?


Solution

  • <body t:type="any" t:mixins="decorator" decorator="shadow" />
    

    upd: refer to t5 doc about any: https://tapestry.apache.org/5.4/apidocs/org/apache/tapestry5/corelib/components/Any.html