Hi Steve,
That's the kind of logic that you'd normally handle with your template.
In TT you can [% INCLUDE "filename" %] to make the site in any way you
like, which is why it is more popular.
From what I can see, HTML::Seamstress requires you to write a
significant amount of perl code to make things happen, which is what TT
is designed to prevent. TT's logic, macros and functions allow you to
easily separate the presentation of your site from the business logic,
which is why it's the view of choice for many.
Okies? :)
Steve H wrote:
Hi all,
(preamble) I've been working for a couple of months now on the strategy,
constraints and designs for using Catalyst for a portal CRM app. I
chose to use Seamstress rather than TT, as it seems a more contemporary
approach - at least the notion of workig with the HTML tree compared to
using another mini language (anyway, perhaps if the related doco was
more extensive, example-wise, then I'm sure Seamstress would get a
larger following).
Anyway.... the dilema I have is: With Catalyst, how do I compose a html
document from multiple sources. For example I have many Boxes of data,
the creation of which I'd like to generalise, and optionally include
some/none/all in any finally composed page/document (and positioned at
for examle, tags in any doc they could appear in)... like a menu or a
hot-list or other things that may be common to many documents/pages.
At face value, Catalysts model of a Controller to crunch/prepare the
data then a View to render a doc/page, seems to promote a 1-document per
view notion.
For this sort of er, Portal app I'm working on, I'd like to when
composing a page, identify whether or not particular common elements
(say, boxes of data) should be included, and then merely call out to
some common functoin to build the things which I then stitch them in at
the appropriate place in the final doc.
Seems to me that at the point in processing I need to intervene (the
final page's View), the doc is the compiled/hash representing the html
doc tree. I can certainly look_down() and replace_content() in that
tree.... how though can I call some other function that will return the
appropriate structure to stitch in. If they were their own View, they
would parse a doc fragment (or even a larger doc with lots of common
fragments) into a tree in it's new()... then I'd call in to some
function that would build and return me the structure that I could
push/replace/splice in to the tree I'm composing.
Although I'm a well experienced programmer from way back :(from the old
top-down days though), I am still struggling to get my head around the
whole interitence and calling model of the Catalyst OO framework... in
who does what to who, when, for how much, and where did they meet.
Hopefully what I'm trying to do is pretty 101 stuff, and someone with
the right Catalyst/Seamstress stuff can 'show me the way'... as I'm
going nuts trying out different things from Google'ing.
regards
Steve
_________________________________________________________________
Advertisement: Visit LetsShop.com to WIN Fabulous Books Weekly
http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fwww%2Eletsshop%2Ecom%2FLetsShopBookClub%2Ftabid%2F866%2FDefault%2Easpx&_t=751480117&_r=HM_Tagline_books&_m=EXT
_______________________________________________
List: [email protected]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/
_______________________________________________
List: [email protected]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/