Re: Part 2 - [showif] if variable exists

This WebDNA talk-list message is from

1998


It keeps the original formatting.
numero = 20372
interpreted = N
texte = >[ShowIf [url][wogroup1datarq][/url]![raw][wogroup1datarq][/raw]] >[wogroup1datarq] >[/ShowIf] > >It works fine as long as the variable actually exists, but if it does not >find the variable, it still shows [wogroup1datarq] instead of hiding the >variable. Any ideas why this would not work? I cannot see anything wrong with the code above, and no, using hideifs instead won't change anything here. If the variable does NOT exist, both sides should resolve to the same thing, [wogroup1datarq], and that means the enclosed stuff should NOT be displayed.Try removing the url context and see if that helps. I don't see why it would, but then again I generally do not wrap my tags in url contexts, I usually just do this:[showif [wogroup1datarq]![raw][wogroup1datarq][/raw]] [wogroup1datarq] [/showif]Just remember, Jay had a good reason for putting that url context in there. It will prevent the search from failing if your user types in a & (or some other character that needs to be url-ized) into the field this variable represents. But if your users are setting this value from a checkbox or popup menu or radio buttons, you shouldn't need the url context because you're the one responsible for creating the list of values for this variable, and you can make them all url-compatible yourself.Special Note:I've had times during development of webcat sites when my showifs and hideifs suddenly decided to behave exactly the opposite of how they should. It's some kind of webcat glitch that's basically impossible to reproduce consistently, so when I see it happen, I restart the computer, the glitch goes away, and everything seems to be fine from then on.If all else fails, try restarting ... :)Sincerely, Ken Grome 808-737-6499 WebDNA Solutions mailto:ken@webdna.net http://www.webdna.net Associated Messages, from the most recent to the oldest:

    
  1. Re: Part 2 - [showif] if variable exists (PCS Technical Support 1998)
  2. Re: Part 2 - [showif] if variable exists (Kenneth Grome 1998)
  3. Re: Part 2 - [showif] if variable exists (Mike Eberly 1998)
  4. Re:Part 2 - [showif] if variable exists (Kenneth Grome 1998)
  5. Re: Part 2 - [showif] if variable exists (Andy Rayman 1998)
  6. Re:Part 2 - [showif] if variable exists (Jay Van Vark 1998)
  7. Re: Part 2 - [showif] if variable exists (Dave MacLeay 1998)
  8. Part 2 - [showif] if variable exists (Mike Eberly 1998)
>[ShowIf [url][wogroup1datarq][/url]![raw][wogroup1datarq][/raw]] >[wogroup1datarq] >[/ShowIf] > >It works fine as long as the variable actually exists, but if it does not >find the variable, it still shows [wogroup1datarq] instead of hiding the >variable. Any ideas why this would not work? I cannot see anything wrong with the code above, and no, using hideifs instead won't change anything here. If the variable does NOT exist, both sides should resolve to the same thing, [wogroup1datarq], and that means the enclosed stuff should NOT be displayed.Try removing the url context and see if that helps. I don't see why it would, but then again I generally do not wrap my tags in url contexts, I usually just do this:[showif [wogroup1datarq]![raw][wogroup1datarq][/raw]] [wogroup1datarq] [/showif]Just remember, Jay had a good reason for putting that url context in there. It will prevent the search from failing if your user types in a & (or some other character that needs to be url-ized) into the field this variable represents. But if your users are setting this value from a checkbox or popup menu or radio buttons, you shouldn't need the url context because you're the one responsible for creating the list of values for this variable, and you can make them all url-compatible yourself.Special Note:I've had times during development of webcat sites when my showifs and hideifs suddenly decided to behave exactly the opposite of how they should. It's some kind of webcat glitch that's basically impossible to reproduce consistently, so when I see it happen, I restart the computer, the glitch goes away, and everything seems to be fine from then on.If all else fails, try restarting ... :)Sincerely, Ken Grome 808-737-6499 WebDNA Solutions mailto:ken@webdna.net http://www.webdna.net Kenneth Grome

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:

What am I missing (1997) WebCat with WebTen (1998) Configuration Q (1998) [Sum] function? (1997) shipcost (1997) shipcost - cleaner with a table (1998) International Orders (1998) WebCat2 - many [carts] on one template page? (1997) Weird Math and SV Bad News (1997) [WebDNA] Store module/site (2012) WebCatalog Upgrade Pricing? (1997) Authenticating users without dialog box (1997) item sorting (1997) Proper file locations (1997) Separate SSL Server (1997) Running _every_ page through WebCat ? (1997) WCS Newbie question (1997) More NT encyption!! (1999) IIS4b2 and WebCatalog b19 (1997) cybercash question (2000)