• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

List list

LEGEND ,
Jun 21, 2006 Jun 21, 2006

Copy link to clipboard

Copied

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


TOPICS
Advanced techniques

Views

421

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 21, 2006 Jun 21, 2006

Copy link to clipboard

Copied

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
>


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 21, 2006 Jun 21, 2006

Copy link to clipboard

Copied

Thanks for the link, but that is a little bit confusion. lol. It doesnt
really tell you how to get one look to another.


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jun 21, 2006 Jun 21, 2006

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 22, 2006 Jun 22, 2006

Copy link to clipboard

Copied

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>


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 22, 2006 Jun 22, 2006

Copy link to clipboard

Copied

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.
>


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 22, 2006 Jun 22, 2006

Copy link to clipboard

Copied

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.


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 22, 2006 Jun 22, 2006

Copy link to clipboard

Copied

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.
>


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 22, 2006 Jun 22, 2006

Copy link to clipboard

Copied

LATEST
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.


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation