Thanks for all the tips! I had thought about using my own counter, but thought it wouldn't work with pagination tools like cf_recordcount. Of course, they can be work together! It's up and running like a charm now.

For what it's worth, here's how I integrated my homemade counter with the cf_recordcount custom tag. Grouped output, next-previous links, AND the right number of rows. Woo hoo!
c

----------------

<CFPARAM NAME="mystartrow" DEFAULT="1">
<CFPARAM NAME="realstartrow" DEFAULT="1">

<cfquery name="research" datasource="n">
SELECT p.publication_id, p.publication_title, p.publication_url, a.author_name, a.author_id

FROM   publications p, publication_author pa, authors a
WHERE  p.publication_id = pa.pub_id
AND    pa.auth_id = a.author_id

order by publication_date desc, publication_title;
</cfquery>

<cfset request.RCQuery = research>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
[...]

<!--- display next/previous links --->
<cf_recordcount
  part="recordcount"
  MyStartRow="#mystartrow#"
  RealStartRow="#realstartrow#"
  group="publication_title"
  mymaxrows="10"
  RCItem="item"
  cfmx="1"
>
<cf_recordcount
  template="rsc-index.cfm"
  part="link"
  RCResults="#RCResults#"
  PrevStart="#PrevStart#"
  NextStart="#NextStart#"
  RealPrevStart="#RealPrevStart#"
  RealNextStart="#RealNextStart#"
  MyMaxRows="#mymaxrows#"
  MyMaxPages="10"
  pagecount="#pagecount#"
  thispage="#thispage#"
  showpage="no"
>

<!--- begin results table --->
<table width="100%">

<!--- reset counter for this page --->
<cfset numrecord = 0>

<!--- one block per result --->
<cfoutput query="research" group="publication_title" startrow="#realstartrow#">

<!--- compare the counter to the maxrows in cf_recordcount --->
<cfset numrecord = numrecord + 1>
<cfif numrecord lte mymaxrows>

        <tr valign="top">
          <td colspan="2">
           <a href=""
   </td>
        </tr>

        <tr valign="top">
          <td width="20%"><strong>Author(s):</strong></td>
          <td width="80%">
           <cfoutput group="author_name">
             #author_name#<br>
           </cfoutput></td>
        </tr>

<!--- end this result and loop to the next --->
</cfif>
</cfoutput>

<!--- end the entire results table --->
    </table>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to