I know that this issue was discussed in the past (e.g.
http://www.nabble.com/Equivalent-of-jwcid%3D%22%24content%24%22-in-T5-td17581189s302.html#a17581189,
http://www.nabble.com/T5-equivalent-of-%24content%24-td9138619s302.html#a9138619)
and the conclusion was there currently is no equivalent of jwcid="$content$"
from T4. Now, I can understand how the proposed workarounds would work, but
I most definitely like being able to annotate a fully working/previewable
html page, and make it work in Tapestry without having to gut pretty much
the whole thing.

Now, here's what I do :

Layout component template (it's the regular stuff) , e.g. :

Layout.html
<html>
  <head> ... </head>
  <body>
    <div id="header"> ...</div>
    <div id="content"> <t:body /> </div>
    <div id="footer"> .. </div>
  </body>
</html>

Page1.html would typically come as a full html doc, now, I only care for the
stuff inside of 'content' div.

<html>
  <head> ... </head>
  <body>
    <div id="header"> ...</div>
    <div id="content"> Foo, bar baz </div>
    <div id="footer"> .. </div>
  </body>
</html>

If there were a $content$, I'd do something like this in Page1:

<html>
  <head> ... </head>
  <body>
    <div id="header"> ...</div>
    <div id="content" t:type="$content$">
         <t:layout > Foo, bar baz </t:layout>
    </div>
    <div id="footer"> .. </div>
  </body>
</html>

Now, since  there is no $content$, I have to either totally gut the
previewability of the template:
<t:layout > Foo, bar baz </t:layout>

Or, I have to do something like this :

<html t:type="layout">
  <head t:type="remove"> ... </head>
  <body t:type="container">
    <div id="header" t:type="remove"> ...</div>
    <div id="content" t:type="container">
         Foo, bar baz
    </div>
    <div id="footer" t:type="remove"> .. </div>
  </body>
</html>

Now, let's admit it, the next to last version is definitely most concise,
but kills one of the huge Tapestry perks : previewability. The last version
should work (I haven't tried it yet), but man, it's becomes cluttered w/
these "remove" and "container" elements that just clutter things (and mind
you, this is a simple layout, if the layout is more complicated it gets even
uglier).

I also found this solution :
http://www.nabble.com/Re-%3A-Re-%3A-T5%3A-Layout-question-to16448904.html#a16448904,
but life just becomes a little uglier with it. I see that we're
jumping
through these hoops to prevent template previewability and so if it becomes
too much of a hassle to deal with I can scrap previewability. However, it's
such a pity when it was nice and elegant in T4, and not it's a little worse.


I also see that there is an idea to have t:container serve almost like
$content$ by discarding its parent..

So, I wonder, would there be any possibility of being able to restore the
existence of the $content$ component ? Is there something in T5 that makes
it impossible technically ? Or is there a phylosophical objection to its
existence in the first place ? Any comments ?

Thanks,

Alex Kotchnev

Reply via email to