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 (forexample, as insecure text variables with blank values) you willnever have this problem again. Here's why:This is the hierarchy of variables in every WebDNA page:secure text variablesincoming formvariablesinsecure text variablesIncoming formvariables override insecure text variables, andsecure text variables override incoming formvariables. So if youinitialize all your variables as insecure text variables at thetop 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, orthose initial values will have been overridden by your incomingformvariable values (or by the setting of secure text variables ofcourse).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 UNinitializedvariables, but yours were initialized at the top of the page!:)So now you can use this simpler and more elegant code when doingall your comparisons, and it will always work as expected:[showif [url][selector][/url]=]Regards,Kenneth GromeWebDNA Solutionshttp://www.webdnasolutions.comWeb Database Systems and Linux Server ManagementOn 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:
> 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 (forexample, as insecure text variables with blank values) you willnever have this problem again. Here's why:This is the hierarchy of variables in every WebDNA page:secure text variablesincoming formvariablesinsecure text variablesIncoming formvariables override insecure text variables, andsecure text variables override incoming formvariables. So if youinitialize all your variables as insecure text variables at thetop 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, orthose initial values will have been overridden by your incomingformvariable values (or by the setting of secure text variables ofcourse).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 UNinitializedvariables, but yours were initialized at the top of the page!:)So now you can use this simpler and more elegant code when doingall your comparisons, and it will always work as expected:[showif [url][selector][/url]=]Regards,Kenneth GromeWebDNA Solutionshttp://www.webdnasolutions.comWeb Database Systems and Linux Server ManagementOn 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)