[ic] identify specific more list pages SOLVED

Paul Jordan interchange-users@icdevgroup.org
Wed Oct 2 13:28:00 2002


> Paul Jordan [paul@gishnetwork.com] wrote:
> >
> > I have a product type page, lets say of opera music. It describes the
> > product and gives a little history of said product. This main page also
> > displays the first 12 product results via an in-page  sql query
> with more=1.
> >
> > I would like to have all subsequent "opera" pages 2,3,4,5 be minus the
> > description and history. However if the person decides to go
> back to page
> > '1' they would again see the description and history, kinda
> making it a home
> > page for the product.
> >
> > in pseudo code it would be:
> >
> > [if page first_result_set]show this[/if]
> > or
> > [if more_list_page == 1]show this[/if]
> >
> > Basically I need to show products on this page, but it also
> needs to act as
> > a "more information" home page for said product.
> >
> > Is there any way to identify result pages?
> >
> > Not looking for a freebie, just a hint or a direction. Or am I
> overlooking
> > an easier way to do this :)
> >
> How about something like this:
>
>     [if value mv_first_match]
>         On a subsequent page
>     [else]
>         On the first page
>     [/else]
>     [/if]


OK here is what I did:

    [query
        ml=12
        type=list
        more=1
        sp="@@MV_PAGE@@"
        sql=|
        SELECT  pp.price, pp.append, pd.sku, pd.title, pd.comment, pd.type
        FROM    products pd, properties pp
        WHERE   pd.searched BETWEEN '15' AND '16'
        AND     pd.cap_group = pp.cap_group
        ORDER BY pd.sku
        |]

        [list]
		[if explicit]
			[condition]
			$num = '[sql-increment]';
			return 1 if $num eq 1;
			return 0;
			[/condition]

		....general product header.....

		[/if]
	  [/list]

	  [list]

	...actual products iteration...

	  [/list]

		[more-list]
			Products [matches] of [match-count]
			<BR>[more]<BR>
		[/more-list]

    [/query]


This will let you distiguish from the first product iteration, so you can do
a specific product line display, with a header (description) that is only
present above the first result set making it a kind of specific product line
"main" page.

page 1 will have description, however 2,3,4... will not.

Hope this helps someone in the future.

Paul

BTW I am not sayin it is efficient, but it was all I could figure out to do
:)