Re: [WebDNA] showif with empty variable

This WebDNA talk-list message is from

2015


It keeps the original formatting.
numero = 112174
interpreted = N
texte = > I am having an 'age-old' problem with webDNA. > I want to use a showif tag with an empty variable. If you initialize all your variables at the top of the page (for example, as insecure text variables with blank values) you will never have this problem again. Here's why: This is the hierarchy of variables in every WebDNA page: secure text variables incoming formvariables insecure text variables Incoming formvariables override insecure text variables, and secure text variables override incoming formvariables. So if you initialize all your variables as insecure text variables at the top of the page like this: [text secure=f]selector=[/text] ... your [selector] tags in the same page will always have values. Either they will still have their initialized "blank" values, or those initial values will have been overridden by your incoming formvariable values (or by the setting of secure text variables of course). This means you'll never have to mess with this [raw] code trick: [showif [url][selector][/url]=[raw][selector][/raw]] ... because its only purpose is to deal with UNinitialized variables, but yours were initialized at the top of the page! :) So now you can use this simpler and more elegant code when doing all your comparisons, and it will always work as expected: [showif [url][selector][/url]=] Regards, Kenneth Grome WebDNA Solutions http://www.webdnasolutions.com Web Database Systems and Linux Server Management On 03/13/2015 05:59 PM, Steve Braun wrote: > Hi All, > I am having an 'age-old' problem with webDNA. > I want to use a showif tag with an empty variable. > I've read some of the archives, but they don't seem to apply. > > This works: > [showif [selector]=home] [include home_page.inc] [/showif] > [showif [selector]=local] [include local_page.inc] [/showif] > > How do I make this work? > [showif [selector]=] [include blank_page.inc] [/showif] > > Thanks for any assistance. > > Stephen F Braun > sbraun1@twcny.rr.com > --------------------------------------------------------- This > message is sent to you because you are subscribed to the mailing > list . To unsubscribe, E-mail to: archives: > http://mail.webdna.us/list/talk@webdna.us Bug Reporting: > support@webdna.us Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] showif with empty variable (Brian Burton 2015)
  2. Re: [WebDNA] showif with empty variable (Donovan Brooke 2015)
  3. Re: [WebDNA] showif with empty variable (Brian Burton 2015)
  4. Re: [WebDNA] showif with empty variable (Donovan Brooke 2015)
  5. Re: [WebDNA] showif with empty variable (Dan Strong 2015)
  6. Re: [WebDNA] showif with empty variable (Terry Wilson 2015)
  7. Re: [WebDNA] showif with empty variable (Kenneth Grome 2015)
  8. Re: [WebDNA] showif with empty variable (Steve Braun 2015)
  9. Re: [WebDNA] showif with empty variable (Steve Braun 2015)
  10. Re: [WebDNA] showif with empty variable (Kenneth Grome 2015)
  11. Re: [WebDNA] showif with empty variable (Donovan Brooke 2015)
  12. Re: [WebDNA] showif with empty variable (Brian Burton 2015)
  13. Re: [WebDNA] showif with empty variable (Terry Wilson 2015)
  14. Re: [WebDNA] showif with empty variable (Dan Strong 2015)
  15. [WebDNA] showif with empty variable (Steve Braun 2015)
> I am having an 'age-old' problem with webDNA. > I want to use a showif tag with an empty variable. If you initialize all your variables at the top of the page (for example, as insecure text variables with blank values) you will never have this problem again. Here's why: This is the hierarchy of variables in every WebDNA page: secure text variables incoming formvariables insecure text variables Incoming formvariables override insecure text variables, and secure text variables override incoming formvariables. So if you initialize all your variables as insecure text variables at the top of the page like this: [text secure=f]selector=[/text] ... your [selector] tags in the same page will always have values. Either they will still have their initialized "blank" values, or those initial values will have been overridden by your incoming formvariable values (or by the setting of secure text variables of course). This means you'll never have to mess with this [raw] code trick: [showif [url][selector][/url]=[raw][selector][/raw]] ... because its only purpose is to deal with UNinitialized variables, but yours were initialized at the top of the page! :) So now you can use this simpler and more elegant code when doing all your comparisons, and it will always work as expected: [showif [url][selector][/url]=] Regards, Kenneth Grome WebDNA Solutions http://www.webdnasolutions.com Web Database Systems and Linux Server Management On 03/13/2015 05:59 PM, Steve Braun wrote: > Hi All, > I am having an 'age-old' problem with webDNA. > I want to use a showif tag with an empty variable. > I've read some of the archives, but they don't seem to apply. > > This works: > [showif [selector]=home] [include home_page.inc] [/showif] > [showif [selector]=local] [include local_page.inc] [/showif] > > How do I make this work? > [showif [selector]=] [include blank_page.inc] [/showif] > > Thanks for any assistance. > > Stephen F Braun > sbraun1@twcny.rr.com > --------------------------------------------------------- This > message is sent to you because you are subscribed to the mailing > list . To unsubscribe, E-mail to: archives: > http://mail.webdna.us/list/talk@webdna.us Bug Reporting: > support@webdna.us 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:

WebCat editing, SiteGuard & SiteEdit (1997) HTTP 404 / Error Mapping (2001) Feature Request [TABLE ... &delimiters=] (2007) Show if time tags (1997) Search context not finding recent entries (1998) [format xs] freeze (1997) [WebDNA] topbanner.inc code (2011) Multiple prices (1997) WebDNA and SQL (2003) ampersand (1998) Re:Virtual hosting and webcatNT (1997) Server crash (1997) WebCat2 several catalogs? (1997) Latin Characters (1998) Changes to [ReturnRaw] in 3.0 (1998) Document Contains No Data! (1997) Urgent Help needed (1998) Requiring that certain fields be completed (1997) Extended [Convertchars] needed (1997) RE: storefront (1998)