From: Jonathan S. <sw...@po...> - 2001-05-31 17:09:59
|
There is a todo item for this feature (called "placeholders"): http://www.masonhq.com/docs/todo/view.html?id=120 but it probably won't happen anytime soon, so for now, I recommend using a filter and/or a global hash to record the element values. We do this for page titles on masonhq.com. Every page has to output, somewhere, <mhq:title>My Title</mhq:title> In the final part of the autohandler we look for this tag, grab out the title, and insert a <title> into the output. Jon > I have various elements that need to appear at the top of the page (in the > html output that is) [0]. However these elements are computed at various > points of the page output-wise (and the logic cannot be worked out at the > autohandler level) > > Has anyone else managed to move bits of the output around successfully or > have any good ideas? > > My ideas (not too good): > > 1. Put markers around them and simply move them at the end with a > filter [1] > > 2. Have some horrible shared variable that tracks them around and > bung them > in there via a method call > > > Is there some slicker, better way? > > > > > [0] If people can't guess what these elements are, they're absolutely > positioned divs. Thanks to bugs in the various browser, if you want to > manipulate these divs and display them correctly, you must place the divs > immediately after the body tag. Although I can think of many other > non-useless uses. > > [1] Incidentally maybe someone can point out a better way of filtering the > output via another component than my kludgetastic effort: > > > <%filter> > > s/([\s\S]*)//; # match everything > > my $output = $1; # and copy to $output > > $output = $m->comp($filter, input=>$output); > > $m->out($output); > > </%filter> > > > > _______________________________________________ > Mason-users mailing list > Mas...@li... > http://lists.sourceforge.net/lists/listinfo/mason-users |