Re: [showif] results returned...

This WebDNA talk-list message is from

2003


It keeps the original formatting.
numero = 50686
interpreted = N
texte = Hi Alan,Your code appears to be consistent with what I was thinking. As for making the menu, you're on the right track with the logic you propose. I don't think you can do just one search and get the results for each range. If I'm wrong about this, I'm sure someone on the list can let us know. I'd suggest the following to perhaps tighten up the code: -1. include the opening menu code 0. repeat 1 and 2 for all the ranges 1. search for the range 2. show the menu *item* code for the range if the number found [numfound] is greater than zero (you may need to make sure that items with zero quantity are excluded from the search) 3. close the menu code after you've repeated for all of your rangesThe difference is that you don't need to have a separate search for each range if you can somehow consolidate it. I forget what real programmers call this, but it means less effort in trying to change things later. It also provides more portable code. Although I haven't tried it, in version 5 of WebDNA, you might be able to use the function context. I don't have the syntax in front of me, but it should work like: 1. open the menu 2. function menuitem with value _low 3. function menuitem with value _med 4. function menuitem with value _highThe function would contain steps 1 (search for range) and 2 (return menu item if appropriate) of the first list above. Bill-----Original Message----- From: Alan White Sent: Tue, 27 May 2003 14:05:38 To: (WebDNA Talk) Subject: Re: [showif] results returned...Hi BillThis is how I have done the menu:-[!] ------------------------------------------------------------ [/!] [!] ---- This is a Search based on price range ---- [/!] [!] ------------------------------------------------------------ [/!] and the results have been done in this format...[!] ------------------------------------------------------------ [/!] [!] ---- Price Search Results ---- [/!] [!] ------------------------------------------------------------ [/!][showif [search_type]=_PRICE] PRICE RESULTS

[text]range=[the_PRICE][/text] [showif [range]=_small] These Items Cost £50 or Less

[search db=database.db&lePRICEdatarq=50&PRICEtype=num&grNO_INVENTORYdatarq=0&NO_INVE NTORYtype=num&nePRODUCT_IDdatarq=find_all&PRODUCT_IDsumm=T&sort=1] [founditems] [TITLE]
[/founditems] [/search] [/showif] [showif [range]=_medium] These Items Cost £50 - £100

[search db=database.db&rnPRICEdatarq=50 100&PRICEtype=num&grNO_INVENTORYdatarq=0&NO_INVENTORYtype=num&sort=1&nePRODU CT_IDdatarq=find_all&PRODUCT_IDsumm=T] [founditems] [TITLE]
[/founditems] [/search] [/showif]etc etc for the other results...I wasn't quite sure how to go about making a comparison against the database to see if a range was available so I could apply the logic:-[search db] [showif range=available] menu item [/showif][search db] [showif range=available] menu item [/showif][search db] [showif range=available] menu item [/showif]I am also unsure as to whether this is the right train of thought... Would it be possible to do one search which I could then compare against and use similar logic?I guess I am still getting used to all of this so please bare with me...ThanksAlanon 26/5/03 7:15 am, William DeVaul at devaulw@onebox.com wrote:> Sorry, but this is on a thumb keyboard. Can't you use the range > parameter of the search context? I assume that the user selected high > and low values are passed or somehow made available to the search. For > example, if the value apparent in the menu is $10 to $20, the form value > is 'A'. On the search page, 'A' indicates a low range value of $10 and > a high of $20. You could also pass the form value of '$10 - $20' and > then pull out the values from the form variable using grep, listwords or > the like. > > Bill > > > Alan White wrote: > >> To: (WebDNA Talk) >> Date: Mon, 26 May 2003 15:17:21 >> Subject: [showif] results returned... >> From: Alan White >> >> Hi >> >> I have just created a menu with various price ranges in it. How do I then >> add a search and [showif] that will allow me to only have these price >> ranges shown if results are found based on the search? >> >> TIA >> >> Alan White >> ------------------------------ >> http://www.streethreds.com >> >> >> >> ------------------------------------------------------------- >> 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 >> >> Web Archive of this list is at: http://webdna.smithmicro.com/ > > ------------------------------------------------------------- > 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 > > Web Archive of this list is at: http://webdna.smithmicro.com/ ------------------------------------------------------------- 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 Web Archive of this list is at: http://webdna.smithmicro.com/------------------------------------------------------------- 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 Web Archive of this list is at: http://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: [showif] results returned... (Alan White 2003)
  2. Re: [showif] results returned... (William DeVaul 2003)
  3. Re: [showif] results returned... (Alan White 2003)
  4. Re: [showif] results returned... (devaulw@onebox.com 2003)
  5. Re: [showif] results returned... (Alan White 2003)
  6. Re: [showif] results returned... (William DeVaul 2003)
  7. [showif] results returned... (Alan White 2003)
Hi Alan,Your code appears to be consistent with what I was thinking. As for making the menu, you're on the right track with the logic you propose. I don't think you can do just one search and get the results for each range. If I'm wrong about this, I'm sure someone on the list can let us know. I'd suggest the following to perhaps tighten up the code: -1. include the opening menu code 0. repeat 1 and 2 for all the ranges 1. search for the range 2. show the menu *item* code for the range if the number found [numfound] is greater than zero (you may need to make sure that items with zero quantity are excluded from the search) 3. close the menu code after you've repeated for all of your rangesThe difference is that you don't need to have a separate search for each range if you can somehow consolidate it. I forget what real programmers call this, but it means less effort in trying to change things later. It also provides more portable code. Although I haven't tried it, in version 5 of WebDNA, you might be able to use the function context. I don't have the syntax in front of me, but it should work like: 1. open the menu 2. function menuitem with value _low 3. function menuitem with value _med 4. function menuitem with value _highThe function would contain steps 1 (search for range) and 2 (return menu item if appropriate) of the first list above. Bill-----Original Message----- From: Alan White Sent: Tue, 27 May 2003 14:05:38 To: (WebDNA Talk) Subject: Re: [showif] results returned...Hi BillThis is how I have done the menu:-[!] ------------------------------------------------------------ [/!] [!] ---- This is a Search based on price range ---- [/!] [!] ------------------------------------------------------------ [/!] and the results have been done in this format...[!] ------------------------------------------------------------ [/!] [!] ---- Price Search Results ---- [/!] [!] ------------------------------------------------------------ [/!][showif [search_type]=_PRICE] PRICE RESULTS

[text]range=[the_PRICE][/text] [showif [range]=_small] These Items Cost £50 or Less

[search db=database.db&lePRICEdatarq=50&PRICEtype=num&grNO_INVENTORYdatarq=0&NO_INVE NTORYtype=num&nePRODUCT_IDdatarq=find_all&PRODUCT_IDsumm=T&sort=1] [founditems] [TITLE]
[/founditems] [/search] [/showif] [showif [range]=_medium] These Items Cost £50 - £100

[search db=database.db&rnPRICEdatarq=50 100&PRICEtype=num&grNO_INVENTORYdatarq=0&NO_INVENTORYtype=num&sort=1&nePRODU CT_IDdatarq=find_all&PRODUCT_IDsumm=T] [founditems] [TITLE]
[/founditems] [/search] [/showif]etc etc for the other results...I wasn't quite sure how to go about making a comparison against the database to see if a range was available so I could apply the logic:-[search db] [showif range=available] menu item [/showif][search db] [showif range=available] menu item [/showif][search db] [showif range=available] menu item [/showif]I am also unsure as to whether this is the right train of thought... Would it be possible to do one search which I could then compare against and use similar logic?I guess I am still getting used to all of this so please bare with me...ThanksAlanon 26/5/03 7:15 am, William DeVaul at devaulw@onebox.com wrote:> Sorry, but this is on a thumb keyboard. Can't you use the range > parameter of the search context? I assume that the user selected high > and low values are passed or somehow made available to the search. For > example, if the value apparent in the menu is $10 to $20, the form value > is 'A'. On the search page, 'A' indicates a low range value of $10 and > a high of $20. You could also pass the form value of '$10 - $20' and > then pull out the values from the form variable using grep, listwords or > the like. > > Bill > > > Alan White wrote: > >> To: (WebDNA Talk) >> Date: Mon, 26 May 2003 15:17:21 >> Subject: [showif] results returned... >> From: Alan White >> >> Hi >> >> I have just created a menu with various price ranges in it. How do I then >> add a search and [showif] that will allow me to only have these price >> ranges shown if results are found based on the search? >> >> TIA >> >> Alan White >> ------------------------------ >> http://www.streethreds.com >> >> >> >> ------------------------------------------------------------- >> 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 >> >> Web Archive of this list is at: http://webdna.smithmicro.com/ > > ------------------------------------------------------------- > 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 > > Web Archive of this list is at: http://webdna.smithmicro.com/ ------------------------------------------------------------- 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 Web Archive of this list is at: http://webdna.smithmicro.com/------------------------------------------------------------- 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 Web Archive of this list is at: http://webdna.smithmicro.com/ devaulw@onebox.com

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:

Context and commands (1998) shownext & math (1997) RE: pricing continued (1998) [WebDNA] HTTP Streaming - POSSIBLE! (2010) Nested tags count question (1997) calculating tax rates, mail order solutions and version 2 (1997) forming a SKU (1999) RE: OK, here goes... (1997) WCf2 and nested tags (1997) Transferring [cart] to Database (1997) redirect from the errorsMessages.db entry (1997) WebCat2 beta 11 - new prefs ... (1997) PCS Frames-Default page is solution! (1997) Hideif not working? (2001) [OT] Good javascript book? (2002) Can't load tmpl files (1997) Large database on Mac OS X Server (2000) Date sorting (1997) WebCat2.0 [format thousands .0f] no go (1997) Replace context problem ... (1997)