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 code0. repeat 1 and 2 for all the ranges1. search for the range2. 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 menu2. function menuitem with value _low3. function menuitem with value _med4. 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:38To: (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&rnPRICEdatarq=50100&PRICEtype=num&grNO_INVENTORYdatarq=0&NO_INVENTORYtype=num&sort=1&nePRODUCT_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 databaseto 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... Wouldit be possible to do one search which I could then compare against and usesimilar 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:
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 code0. repeat 1 and 2 for all the ranges1. search for the range2. 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 menu2. function menuitem with value _low3. function menuitem with value _med4. 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:38To: (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&rnPRICEdatarq=50100&PRICEtype=num&grNO_INVENTORYdatarq=0&NO_INVENTORYtype=num&sort=1&nePRODUCT_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 databaseto 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... Wouldit be possible to do one search which I could then compare against and usesimilar 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
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...