Forums
This topic is locked
Detail page (Next - Previouse) HELP!!!!
Posted 07 Mar 2006 18:55:11
1
has voted
07 Mar 2006 18:55:11 Derek Witcher posted:
I have created a master page that is for my picture gallery I am using the thumbnail as a link to my detail page. On my detail page I am showing a
full-size image of the thumbnail. I am trying to setup a previous and next
button that are dynamic with my database I went to Recordset paging and used
Next and Previous but it does not work. I must be missing something can
somebody please give me some assistance. Thanks in advance for the help.
Replies
Replied 11 Mar 2006 00:39:14
11 Mar 2006 00:39:14 Javier Castro replied:
On your the detail page you need to go Under Server behaviors, recordset paging, Move to Specific Record. When you set this up, make sure you select the appropriate recordset. One more thing, on your master page do not select by record id, instead use the same as above, otherwise it will not work.
good luck.
Javier
Edited by - am7555 on 11 Mar 2006 00:41:21
good luck.
Javier
Edited by - am7555 on 11 Mar 2006 00:41:21
Replied 11 Mar 2006 05:01:33
11 Mar 2006 05:01:33 Derek Witcher replied:
Please help me I am a pretty new to the CF thing. Here is the code for my detail page. My master page is located at www.tuscanstonemantels.com/gallery.cfm
Thanks in advance for any help you can give.
<cfparam name="URL.RecordID" default="1">
<cfparam name="URL.tuscan" default="1">
<cfset CurrentPage=GetFileFromPath(GetTemplatePath())>
<cfparam name="PageNum_web" default="1">
<cfquery name="web" datasource="Tuscan">
SELECT LocationFull FROM Gallery WHERE LocationFull = '#URL.tuscan#'</cfquery>
<cfset MaxRows_web=10>
<cfset StartRow_web=Min((PageNum_web-1)*MaxRows_web+1,Max(web.RecordCount,1))>
<cfset EndRow_web=Min(StartRow_web+MaxRows_web-1,web.RecordCount)>
<cfset TotalPages_web=Ceiling(web.RecordCount/MaxRows_web)>
<cfset QueryString_web=Iif(CGI.QUERY_STRING NEQ "",DE("&"&XMLFormat(CGI.QUERY_STRING)),DE(""
)>
<cfset tempPos=ListContainsNoCase(QueryString_web,"PageNum_web=","&"
>
<cfif tempPos NEQ 0>
<cfset QueryString_web=ListDeleteAt(QueryString_web,tempPos,"&"
>
</cfif>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
<table width="40%" border="2" align="center" cellpadding="2" cellspacing="2">
<tr>
<td width="12%"><a href="<cfoutput>#CurrentPage#?PageNum_web=#Max(DecrementValue(PageNum_web),1)##QueryString_web#</cfoutput>"><img src="images/larrow.gif" alt="" width="37" height="23"></a></td>
<td><div align="center"><img src="<cfoutput>#web.LocationFull#</cfoutput>" alt=""></div></td>
<td width="7%"><a href="<cfoutput>#CurrentPage#?PageNum_web=#Min(IncrementValue(PageNum_web),TotalPages_web)##QueryString_web#</cfoutput>"><img src="images/rarrow.gif" alt="" width="37" height="23"></a></td>
</tr>
</table>
<p><a href="<cfoutput>#CurrentPage#?PageNum_web=1#QueryString_web#</cfoutput>">First</a></p>
<p> </p>
<a href="<cfoutput>#CurrentPage#?PageNum_web=#Min(IncrementValue(PageNum_web),TotalPages_web)##QueryString_web#</cfoutput>">Next</a>
</body>
</html>
Thanks in advance for any help you can give.
<cfparam name="URL.RecordID" default="1">
<cfparam name="URL.tuscan" default="1">
<cfset CurrentPage=GetFileFromPath(GetTemplatePath())>
<cfparam name="PageNum_web" default="1">
<cfquery name="web" datasource="Tuscan">
SELECT LocationFull FROM Gallery WHERE LocationFull = '#URL.tuscan#'</cfquery>
<cfset MaxRows_web=10>
<cfset StartRow_web=Min((PageNum_web-1)*MaxRows_web+1,Max(web.RecordCount,1))>
<cfset EndRow_web=Min(StartRow_web+MaxRows_web-1,web.RecordCount)>
<cfset TotalPages_web=Ceiling(web.RecordCount/MaxRows_web)>
<cfset QueryString_web=Iif(CGI.QUERY_STRING NEQ "",DE("&"&XMLFormat(CGI.QUERY_STRING)),DE(""

<cfset tempPos=ListContainsNoCase(QueryString_web,"PageNum_web=","&"

<cfif tempPos NEQ 0>
<cfset QueryString_web=ListDeleteAt(QueryString_web,tempPos,"&"

</cfif>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
<table width="40%" border="2" align="center" cellpadding="2" cellspacing="2">
<tr>
<td width="12%"><a href="<cfoutput>#CurrentPage#?PageNum_web=#Max(DecrementValue(PageNum_web),1)##QueryString_web#</cfoutput>"><img src="images/larrow.gif" alt="" width="37" height="23"></a></td>
<td><div align="center"><img src="<cfoutput>#web.LocationFull#</cfoutput>" alt=""></div></td>
<td width="7%"><a href="<cfoutput>#CurrentPage#?PageNum_web=#Min(IncrementValue(PageNum_web),TotalPages_web)##QueryString_web#</cfoutput>"><img src="images/rarrow.gif" alt="" width="37" height="23"></a></td>
</tr>
</table>
<p><a href="<cfoutput>#CurrentPage#?PageNum_web=1#QueryString_web#</cfoutput>">First</a></p>
<p> </p>
<a href="<cfoutput>#CurrentPage#?PageNum_web=#Min(IncrementValue(PageNum_web),TotalPages_web)##QueryString_web#</cfoutput>">Next</a>
</body>
</html>
Replied 11 Mar 2006 05:40:13
11 Mar 2006 05:40:13 Javier Castro replied:
oops, I didn't realized that you were working with CF. I have no experience with it. However, I would assume that what you want to do can be done similarly to the ASP version.
Check this link out
tutorial47.easycfm.com/
tutorial290.easycfm.com/
make a search you'll find resources out there.
Javier
Check this link out
tutorial47.easycfm.com/
tutorial290.easycfm.com/
make a search you'll find resources out there.
Javier
Replied 13 Mar 2006 05:38:39
13 Mar 2006 05:38:39 Derek Witcher replied:
Both of those codes do not work. Does anybody have any other suggestions. Thanks
Replied 13 Mar 2006 11:23:30
13 Mar 2006 11:23:30 Dave Thomas replied:
when you create the master page, DO NOT use a filter on the records. just let dw grab them all.
now when you add your repeat region, the part you want linking, instead of using 'goto detail page' you use ' goto specific record'
try this on a small repeeat region and make sure it's bringing back the right id, for your clicks.
if it does, add the nav bar to the page.
never done it in cf, but i have done it in asp and php. so the theory is exactly the same.
regards
Dave Thomas
<b>DMX Zone Forums Manager</b>
Tip: Use Google or our own Search function to find answers before asking. You'd be surprised what's already written <img src=../images/dmxzone/forum/icon_smile_wink.gif border=0 align=middle>
now when you add your repeat region, the part you want linking, instead of using 'goto detail page' you use ' goto specific record'
try this on a small repeeat region and make sure it's bringing back the right id, for your clicks.
if it does, add the nav bar to the page.
never done it in cf, but i have done it in asp and php. so the theory is exactly the same.
regards
Dave Thomas
<b>DMX Zone Forums Manager</b>
Tip: Use Google or our own Search function to find answers before asking. You'd be surprised what's already written <img src=../images/dmxzone/forum/icon_smile_wink.gif border=0 align=middle>