8 Replies Latest reply on Jun 22, 2006 3:39 PM by Newsgroup_User

    List list

    Level 7
      Anyone know where I can find information on how to code a link list for a
      result of a database?

      I would like to be able to loop the results a certain number of times (i.e.
      10 times) and create a list at the bottom for navigation:

      1-10 | 11-20 | 21-30 | 31-34

      --
      Wally Kolcz
      Developer / Support


        • 1. Re: List list
          Level 7
          Take a look at this custom tag.

          http://www.olimpo.ch/tmt/tag/querynav/

          --
          Bryan Ashcraft (remove brain to reply)
          Web Application Developer
          Wright Medical Technologies, Inc.
          ------------------------------------------------------------------
          Macromedia Certified Dreamweaver Developer
          Adobe Community Expert (DW) :: http://www.adobe.com/communities/experts/


          "Wally Kolcz" <wkolcz@projectproofing.com> wrote in message
          news:e7btu3$1vd$1@forums.macromedia.com...
          > Anyone know where I can find information on how to code a link list for a
          > result of a database?
          >
          > I would like to be able to loop the results a certain number of times
          > (i.e. 10 times) and create a list at the bottom for navigation:
          >
          > 1-10 | 11-20 | 21-30 | 31-34
          >
          > --
          > Wally Kolcz
          > Developer / Support
          >


          • 2. Re: List list
            Level 7
            Thanks for the link, but that is a little bit confusion. lol. It doesnt
            really tell you how to get one look to another.


            • 3. Re: List list
              coderWil Level 1
              set a variable that indicates which 'page' you are on:
              <cfparam name="pg" default="1">
              create the default pageview display
              <cfparam name="pageview" default="">
              Do your query for results. queryname

              Do a loop to the 'recordcount' value.
              <cfset newpg = "1">
              <cfloop from="1" to="#queryname.recordcount#" step="10" index="i">
              add each link
              <cfif newpg gt 1><cfset pageview = pageview & " | "></cfif>
              <cfset pageview = pageview & "<a href='#script_name#?pg=#newpg#'>#i# - #evaluate(i*10)#</a>">
              <cfset newpg = newpage + 1>
              </cfloop>

              <cfoutput>pageview</cfloop>
              Hope this helps
              • 4. Re: List list
                Level 7
                I tried the code you supplied, but it comes up blank with no links at all.
                I would like it to display 1-10 | 11 - 20 | 21 - 23 (for example)
                What am I missing?

                <cfparam name="pg" default="1">
                <cfparam name="pageview" default="">
                <cfset newpg = "1">
                <cfloop from="1" to="#rottys.recordcount#" step="10" index="i">
                <cfif newpg gt 1>
                <cfset pageview = pageview & " | "></cfif>
                <cfset pageview = pageview & "<a href='#script_name#?pg=#newpg#'>#i# -
                #evaluate(i*10)#</a>">
                <cfset newpg = newpage + 1>
                </cfloop>


                • 5. Re: List list
                  Level 7
                  What do you mean? The instructions are on the page. You would use the mode
                  attribute to tell the tag which style to use when displaying the links. I
                  would also take a look at the code inside the tag as Massimo is very good
                  about documenting his code.

                  --
                  Bryan Ashcraft (remove brain to reply)
                  Web Application Developer
                  Wright Medical Technologies, Inc.
                  ------------------------------------------------------------------
                  Macromedia Certified Dreamweaver Developer
                  Adobe Community Expert (DW) :: http://www.adobe.com/communities/experts/


                  "Wally Kolcz" <wkolcz@projectproofing.com> wrote in message
                  news:e7cgpn$ojt$1@forums.macromedia.com...
                  > Thanks for the link, but that is a little bit confusion. lol. It doesnt
                  > really tell you how to get one look to another.
                  >


                  • 6. Re: List list
                    Level 7
                    Thanks. I understood it better after I posted it. I am more looking for just
                    the code to do this rather than a custom tag that needs to be installed. I
                    am on a shared host and he doesn't like to install custom tags very often.


                    • 7. Re: List list
                      Level 7
                      You don't have to install anything. Just download the zip file and place the
                      querynav.cfm page somewhere in your site and point the taglib attribute of
                      the cfimport tag to the folder that contains the file. Let's say you put the
                      file in a folder called "_func" off the root. All you would need to do is
                      modify the sample code to look something like this:

                      <cfimport taglib="_func/" prefix="tmt">
                      <tmt:querynav query="myQuery" />
                      <tmt:querynav query="myQuery" mode="pagelist" prevlink="prev"
                      nextlink="next" />

                      --
                      Bryan Ashcraft (remove brain to reply)
                      Web Application Developer
                      Wright Medical Technologies, Inc.
                      ------------------------------------------------------------------
                      Macromedia Certified Dreamweaver Developer
                      Adobe Community Expert (DW) :: http://www.adobe.com/communities/experts/


                      "Wally Kolcz" <wkolcz@projectproofing.com> wrote in message
                      news:e7eb6a$28c$1@forums.macromedia.com...
                      > Thanks. I understood it better after I posted it. I am more looking for
                      > just the code to do this rather than a custom tag that needs to be
                      > installed. I am on a shared host and he doesn't like to install custom
                      > tags very often.
                      >


                      • 8. Re: List list
                        Level 7
                        Ahh. Thanks for the update. When I tried to run it it told me that I was
                        missing the tag. The documentation for the code isn't very clear...well not
                        to my novice brain at least. Thanks again.