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

next n records interfaces

New Here ,
Jan 21, 2007 Jan 21, 2007

Copy link to clipboard

Copied

am having a problem with my next_n records interface.

I have a query for my index page, so when you click on a lettter the appropriate artists are shown....
see here

http://www.musicexplained.co.uk/index.cfm

the query depends on a url variable.

<cfquery name="results" datasource="#APPLICATION.DataSource#">
SELECT *
FROM artist_art
WHERE bandname_art like '#url.firstletter#%'
</cfquery>

i am now setting up a next records interface, so you can easily browse through the artists who begin with a for example, this interface is also dependant on an URL variable....<cfset startrownext>
however, when I click on the next button, see here
http://www.musicexplained.co.uk/index_list_1.cfm?firstletter=a
i lose the variable which is powering the index in the first place..

is there anyway round this?

regards


TOPICS
Advanced techniques

Views

289

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

correct answers 1 Correct answer

Advisor , Jan 21, 2007 Jan 21, 2007
Put this near the top of index_list_1.cfm:

<CFPARAM name="URL.firstletter" type="regex" pattern="[a-zA-Z]" default="a">
<CFPARAM name="URL.startrownext" type="integer" default="1">


Then in all of your pagination links, also include the firstletter parameter again:

<CFOUTPUT>
<a href="#CGI.SCRIPT_NAME#?firstletter=#URL.firstletter#&startrownext=1">First</a>
<a href="#CGI.SCRIPT_NAME#?firstletter=#URL.firstletter#&startrownext=#URL.startrownext + 10#">Next</a>
etc., etc.
</CFOUTPUT>

Votes

Translate

Translate
Advisor ,
Jan 21, 2007 Jan 21, 2007

Copy link to clipboard

Copied

Put this near the top of index_list_1.cfm:

<CFPARAM name="URL.firstletter" type="regex" pattern="[a-zA-Z]" default="a">
<CFPARAM name="URL.startrownext" type="integer" default="1">


Then in all of your pagination links, also include the firstletter parameter again:

<CFOUTPUT>
<a href="#CGI.SCRIPT_NAME#?firstletter=#URL.firstletter#&startrownext=1">First</a>
<a href="#CGI.SCRIPT_NAME#?firstletter=#URL.firstletter#&startrownext=#URL.startrownext + 10#">Next</a>
etc., etc.
</CFOUTPUT>

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
New Here ,
Jan 22, 2007 Jan 22, 2007

Copy link to clipboard

Copied

thanks for this, will give it a go and get back to you

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
Explorer ,
Jan 25, 2007 Jan 25, 2007

Copy link to clipboard

Copied

LATEST
If you want to get a bit fancier, the best CustomTag I've seen for pagination is CF_Search_NextPrevious:

http://www.jeffcoughlin.com/blog/index.cfm/2005/9/12/CFSearchNextPrevious-Custom-Tag-Update-v110

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