[ic] Category Nirvana - tree modifications - horizontal, display just subcats table, component, more...

Dog Tags interchange-users@interchange.redhat.com
Sat Mar 30 13:52:01 2002


Hi All

I'm working with Mike's Tree Example code, and there are a few things that I'd like to modify:

1. I'd like to make the "display" part into a component to take the place of the category_verticle in Foundation. 

2. I want to transfer the "+" and "-" link functions to the category links. Thus, I would like the visitor to be able to click the main category name in the left column and then have that specific category's items and subs displayed in the main body of the page. The cats in the left column would only be the top categories, no subs displayed in the left column.

3. When the visitor gets to that next page (results), they are shown that specific category's (or subcategory's) subcats in a table (with thumbnails and brief subcat descrips) in the main body of the results page (2 or 3 columns - configurable)

4. Also, at the results page, I would like to display any products posted under that category or subcategory that the visitor just clicked. If there were further subcats and items, you would have to click to that subcat to see those particular items. Thus, by clicking a main category, you would NOT necessarily see all items under that category. You would have to click through the respective subcats to view them.

5. I'd like to make it a timed build, perhaps as long as a day or so. I'm not sure if the "tree_build" part would somehow have to be changed. In fact, I'm not sure if there is a more efficient way to do this for category lists that remain unchanged for a month or more.

So, for example, you might have all your main cats in a list in the left column. Then, you'd click "Main Cat 1" and get sent to the results page. On the results page, you'd see a table of "Main Cat 1" subcats at the top of the page, and below that table there would be any products listed as under "Main Cat 1", but no items listed as under "Main Cat 1/subcat1, etc." would be displayed. You would have to click one of the subcats in the table above to see those items.

 I'm still pretty much a newbie with all of this. Would anyone know how to approach what I have suggested?

Thanks very much.

Here is Mike's display code (with a matchlimit piece added by Ton Verhagen).

####  BEGIN  TREE  CODE  ########
<P>
[page href=@@MV_PAGE@@ form="explode=1"]Explode tree[/page]&nbsp;&nbsp;
[page href=@@MV_PAGE@@ form="collapse=1"]Collapse tree[/page]
</P>
<table>
[if cgi toggle]
    [calc]
	my $par = '[data table=tree col=parent_fld key="[cgi toggle]"]';
	delete $Scratch->{memo} if $par eq 'TOP';
	return;
    [/calc]
[/if]

[tree   start=TOP
		table=tree
		master=parent_fld
		subordinate=child_fld
		autodetect=1
		toggle=toggle
		memo=memo
		collapse=collapse
		explode=explode
		spacing=4
		]
	<tr>
	<td>
	[if-item-param mv_level]
			[item-calc]
					return '&nbsp' x [item-param mv_spacing];
			[/item-calc]
	[/if-item-param]
	[if-item-param mv_children]
		<A HREF="[area href=@@MV_PAGE@@ form='toggle=[item-param code]']">
		[item-calc] $Scratch->{memo}{'[item-code]'} ? '-' : '+' [/item-calc]
		</A>
	[/if-item-param]
		[page search="
			fi=products
			st=db
			bs=1
			tf=comb_category
			sf=comb_category
			se=[item-param category]
			ml=10
		"][item-param name]</A>
	</td>

	</tr>
[/tree]
</table>
####  END  TREE  CODE  ###########
-- 

_______________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup

Win the Ultimate Hawaiian Experience from Travelocity.
http://ad.doubleclick.net/clk;4018363;6991039;n?http://svc.travelocity.com/promos/winhawaii/