Re: Can ShowNext do this?

This WebDNA talk-list message is from

2000


It keeps the original formatting.
numero = 27923
interpreted = N
texte = >on 2/11/2000 9:36 AM, Clint Davis at cdavis@mail.grayloon.com wrote: > > > I'm trying to set up a page that will display a story pulled from my > > database. This story has several photos associated with it. Each of > > the photos is a entry into a field in the database named [photo1] - > > [photo16]. I would like to display the first photo with the story and > > a link to the next photo. The next page would display [photo2] with a > > link to [photo3] and so on. I would like to do this with one initial > > page displaying the story and [photo1]. The remaining photos would be > > displayed on a different template (giving me 2 templates total). > > After reaching the final available photo for the story, the user > > would be given a link to return to the story. > > > > I found an example of this done in Cold Fusion: > > http://www.realtree.com/journal/index.cfm > > > > I have played with [ShowNext], but since the photos are in different > > fields, it was getting pretty tricky. Any ideas or examples would be > > much appreciated. > > >I don't think shownext is what you need here. All photos for a particular >story are in a single record, correct? So you just need to set a variable >on the story page that indicates how many photos are associated with that >story. >Check the [photoX] fields in a loop... >[math show=f]x=0[/math] >[loop start=1&end=16] > [showif [interpret][photo[index]][/interpret]!] > [math show=f]x=x+1[/math] > [/showif] >[/loop] >Now you have [x] as the number of photos for your story. Link to the >photoview.tpl page with the SKU of the article and the [x] value, along with >an index [i]... >View Photos > >Then build a photoviewer.tpl page that searches for the SKU and increments >the index. >[search your.db&eqSKUdata=[SKU]&max=1] >[founditems] >Photo [i] for Story [title].
>
>[showif [i]<[x]] >Next Photo >[/showif] >[showif [i]=[x]] >No more photos. Back to the Story >[/showif] >[/founditems] >[/search]Okay, I finally got around to making this happen. BUT, it isn't working. I am able to go from the original story to the photos.tpl page with success. The first photo is displayed and the URL to the next photo shows index=2 and x=number of photos for the story. But when I click the URL, the page reloads with photo 1 still in place and a link to index 2 again. I have checked and rechecked everything with no luck. What's going on?Clint Davis Gray Loon Marketing Group 812.422.9999cdavis@grayloon.com------------------------------------------------------------- Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging Server. To end your Mail problems go to .This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Associated Messages, from the most recent to the oldest:

    
  1. Re: Can ShowNext do this? (Gary Krockover 2000)
  2. Re: Can ShowNext do this? (Gary Krockover 2000)
  3. Re: Can ShowNext do this? SOLVED (Clint Davis 2000)
  4. Re: Can ShowNext do this? (Clint Davis 2000)
  5. Re: Can ShowNext do this? (Mike Davis 2000)
  6. Re: Can ShowNext do this? (Clint Davis 2000)
  7. Can ShowNext do this? (Clint Davis 2000)
>on 2/11/2000 9:36 AM, Clint Davis at cdavis@mail.grayloon.com wrote: > > > I'm trying to set up a page that will display a story pulled from my > > database. This story has several photos associated with it. Each of > > the photos is a entry into a field in the database named [photo1] - > > [photo16]. I would like to display the first photo with the story and > > a link to the next photo. The next page would display [photo2] with a > > link to [photo3] and so on. I would like to do this with one initial > > page displaying the story and [photo1]. The remaining photos would be > > displayed on a different template (giving me 2 templates total). > > After reaching the final available photo for the story, the user > > would be given a link to return to the story. > > > > I found an example of this done in Cold Fusion: > > http://www.realtree.com/journal/index.cfm > > > > I have played with [shownext], but since the photos are in different > > fields, it was getting pretty tricky. Any ideas or examples would be > > much appreciated. > > >I don't think shownext is what you need here. All photos for a particular >story are in a single record, correct? So you just need to set a variable >on the story page that indicates how many photos are associated with that >story. >Check the [photoX] fields in a loop... >[math show=f]x=0[/math] >[loop start=1&end=16] > [showif [interpret][photo[index]][/interpret]!] > [math show=f]x=x+1[/math] > [/showif] >[/loop] >Now you have [x] as the number of photos for your story. Link to the >photoview.tpl page with the SKU of the article and the [x] value, along with >an index [i]... >View Photos > >Then build a photoviewer.tpl page that searches for the SKU and increments >the index. >[search your.db&eqSKUdata=[SKU]&max=1] >[founditems] >Photo [i] for Story [title].
>[interpret][photo[i]][/interpret]>
>[showif [i]<[x]] >[thisurl]?SKU=[SKU]&x=[x]&i=[math]i+1[/math]>Next Photo >[/showif] >[showif [i]=[x]] >No more photos. Back to the Story >[/showif] >[/founditems] >[/search]Okay, I finally got around to making this happen. BUT, it isn't working. I am able to go from the original story to the photos.tpl page with success. The first photo is displayed and the URL to the next photo shows index=2 and x=number of photos for the story. But when I click the URL, the page reloads with photo 1 still in place and a link to index 2 again. I have checked and rechecked everything with no luck. What's going on?Clint Davis Gray Loon Marketing Group 812.422.9999cdavis@grayloon.com------------------------------------------------------------- Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging Server. To end your Mail problems go to .This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Clint Davis

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

Can I invoke an ssi plugin from within a webcat page (1997) Ot-Ip's on OSX (2004) Part Html part WebDNA (1997) Multiple prices (1997) suffix mapping, use of cache, etc. (1997) WebCat2b12--[searchstring] bug (1997) encrypted query string trouble on OSX (2001) Fax Broadcast (1998) WebCat2 - [format thousands] (1997) Changes to the List (1997) ListDatabases & ShowIf (2003) RE: E-mailer error codes (1997) WebCat2b12 Mac.acgi--[searchstring] bug (1997) Loosing Quantity (2000) [WebDNA] Error 500 with SUMM=T (2017) OT: Browser based spell check (2002) Formatting (2000) Country & Ship-to address & other fields ? (1997) Q: for those who use Cookies for sessions? (2004) Shownext from POST (2000)