On Wed, Jun 04, 2003 at 08:53:03AM +0100, Jon Ross wrote: > Hi all, > > I am new to mod_perl/TT2 but not to perl, I come from a J2EE/Struts background so > please forgive my simple question (I have RTFM). > > Following the examples in the manual and the E-Toys demo I can see how to develop > the M and V part of things but it is the simple directory layouts and redirection > that troubles me. > > If I have an e-commerce site which has Category, SubCategory and product pages, I > would develop this in CGI using calls to cgi-bin/category.pl?catNo=x > .../subCategory.pl?catNo=x&subCatNo=y etc. If I could take a separate issue, maybe it would be better to not have subcategories and categores differently. A subcategory is a category without a parent. Make a second table aside from your category table with two columns, parent_id and child_id. Whenever you present the "stuff" for a category (the "lists") if there is no parent (as per the second table) then present the list -- otherwise, keep breaking down the lists and presenting the subcategories, which are really 'categories' with parents. This follows because a category and a subcategory hold the same information, no? Also it solves the problem of what to do when you have a category which has no subcategories? (user won't have to navigate an extra page to see the "lists"). And, it really simplifies the code, you have no double names like cat.pl and subcat.pl. But, it does require coding for the second "relationship" table, unless you are programming server-side SQL and return cursors. > > My question is - > > How do I layout the directories and tell the handler for TT2 to call the appropriate > controller for each level ?. > > My guess on the layout is that I would have something like the following : > > #httpd.conf > <Location /tt2> > SetHandler perl-script > PerlHandler Apache::Template > Options ExecCGI > </Location> > > > # Directory structure > > -/tt2 > /models > - categoryModel.pl > - subCategoryModel.pl > /controls > - categoryControl.pl > - subCategoryControl.pl > /views > - category.html > - subCategory.html > > - but I cannot see how to process the m & c with a call to > http://mysite/category?catNo=x (assuming that is the correct call - please advise). > > > tia > > Jon Ross
-- joseph speigle www.sirfsup.com joe at jklh dot us page: 377-7377 (210) _______________________________________________ templates mailing list [EMAIL PROTECTED] http://lists.template-toolkit.org/mailman/listinfo/templates
