Re: Pretty Easy I bet

This WebDNA talk-list message is from

2000


It keeps the original formatting.
numero = 35171
interpreted = N
texte = a var will only equal null when assigned that value - either on purpose via form var (that includes passed in URLs), or from if you getting a db field value where that field has no text in it yet (this includes orderfile headers).If a var is unititialized (not given a value by any means, then it's value = [var].[showif [URL][var1][/URL]=[URL][raw][var1][/raw][/URL]] var1 has not been initialized (if that is the right terminology... ie var1 has not been assigned a value [/showif]If you are using the XML webcat tags and parser then an unititialized var = undefined (I think. Someone correct me if I am wrong).Always take note if the var is potentially getting its value from: 1) a db field (incl. ordefile header) , or else 2) other means like formvar, [math], [text] , etc.HTH-Johnchas wrote:> Hi > > Search Page: > > I have a search page with 2 contexts > > one displays by a product Category > > one displays by Company > > Results Page > > I have two search contexts > > one shows results of the Category selection > > one shows results of the Company selection > > They both work, but > > I want to hide/show the empty search table and its founditems. > > I have put on the results page to test..... > > category = [category] > > company= [company] > > the context I want to hide = [fieldname] either the [Company] or the [Category] - not a value > > so I have tried: > > [showif [company]=[company]] > > for the category search results > > and > > [hideif [company]!] > > to test the null and therefore hide that context. > What am I missing? > > Thanks In Advance > > Charley Conquest > > results.tpl below > > > > > Results of Your Search > > > [Include file=HSI_Header.inc] > >
>
> Category = [category] >
>
> company = [company] > > [showif [category]=[category]] > [search db=products.db&eqCategorydata=[url][Category][/url]&asCategorysort=1&asCompanysort=2&max=10&startat=[url][startat][/url]] > >

Your search for [Category] found [numFound] items

> >

> Only the first 100 characters of product descriptions are displayed.
> To see a complete product description and a picture (if available) click on the Detail hypertext link.

> >

> > > > > > [foundItems] > > > > > > > > > [/foundItems] > >
CompanyTitleDescriptionPriceActions
[Company][title][description]$[format .2f][price][/format]Add to CartDetail
> > [shownext] > Show Items [start]-[end]
> [/shownext] >
> > [/search] > > [/showif] > > [showif [company]=[company]] > [search db=products.db&eqCompanydata=[url][Company][/url]&asCompanysort=1&max=10&startat=[url][startat][/url]] > >

Your search for [hideif [category]!Strings]'[Category]'[/hideif] [hideif [category]=Strings]'[COMPANY]'[/hideif] found [numFound] items

> >

> Only the first 100 characters of product descriptions are displayed.
> To see a complete product description and a picture (if available) click on the Detail hypertext link.

> >

> > > > > > [foundItems] > > > > > > > > > [/foundItems] > >
CompanyTitleDescriptionPriceActions
[Company][title][description]$[format .2f][price][/format]Add to CartDetail
> > [shownext] > Show Items [start]-[end]
> [/shownext] >
> > [/search] > [/showif] > > Show Shopping Cart
> Back To Search
> > > > > ------------------------------------------------------------- > 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://search.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://search.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Pretty Easy I bet (chas@valley.net (chas) 2000)
  2. Re: Pretty Easy I bet (John Butler 2000)
  3. Pretty Easy I bet (chas@valley.net (chas) 2000)
a var will only equal null when assigned that value - either on purpose via form var (that includes passed in URLs), or from if you getting a db field value where that field has no text in it yet (this includes orderfile headers).If a var is unititialized (not given a value by any means, then it's value = [var].[showif [url][var1][/URL]=[url][raw][var1][/raw][/URL]] var1 has not been initialized (if that is the right terminology... ie var1 has not been assigned a value [/showif]If you are using the XML webcat tags and parser then an unititialized var = undefined (I think. Someone correct me if I am wrong).Always take note if the var is potentially getting its value from: 1) a db field (incl. ordefile header) , or else 2) other means like formvar, [math], [text] , etc.HTH-Johnchas wrote:> Hi > > Search Page: > > I have a search page with 2 contexts > > one displays by a product Category > > one displays by Company > > Results Page > > I have two search contexts > > one shows results of the Category selection > > one shows results of the Company selection > > They both work, but > > I want to hide/show the empty search table and its founditems. > > I have put on the results page to test..... > > category = [category] > > company= [company] > > the context I want to hide = [fieldname] either the [Company] or the [Category] - not a value > > so I have tried: > > [showif [company]=[company]] > > for the category search results > > and > > [hideif [company]!] > > to test the null and therefore hide that context. > What am I missing? > > Thanks In Advance > > Charley Conquest > > results.tpl below > > > > > Results of Your Search > > > [Include file=HSI_Header.inc] > >
>
> Category = [category] >
>
> company = [company] > > [showif [category]=[category]] > [search db=products.db&eqCategorydata=[url][Category][/url]&asCategorysort=1&asCompanysort=2&max=10&startat=[url][startat][/url]] > >

Your search for [Category] found [numFound] items

> >

> Only the first 100 characters of product descriptions are displayed.
> To see a complete product description and a picture (if available) click on the Detail hypertext link.

> >

> > > > > > [founditems] > > > > > > > > > [/foundItems] > >
CompanyTitleDescriptionPriceActions
[Company][title][description]$[format .2f][price][/format][cart]&sku=[url][sku][/url]>Add to Cart[cart]&sku=[url][sku][/url]>Detail
> > [shownext] > [cart]&category=[url][category][/url]&startat=[start]>Show Items [start]-[end]
> [/shownext] >
> > [/search] > > [/showif] > > [showif [company]=[company]] > [search db=products.db&eqCompanydata=[url][Company][/url]&asCompanysort=1&max=10&startat=[url][startat][/url]] > >

Your search for [hideif [category]!Strings]'[Category]'[/hideif] [hideif [category]=Strings]'[COMPANY]'[/hideif] found [numFound] items

> >

> Only the first 100 characters of product descriptions are displayed.
> To see a complete product description and a picture (if available) click on the Detail hypertext link.

> >

> > > > > > [founditems] > > > > > > > > > [/foundItems] > >
CompanyTitleDescriptionPriceActions
[Company][title][description]$[format .2f][price][/format][cart]&sku=[url][sku][/url]>Add to Cart[cart]&sku=[url][sku][/url]>Detail
> > [shownext] > [cart]&Company=[url][Company][/url]&startat=[start]>Show Items [start]-[end]
> [/shownext] >
> > [/search] > [/showif] > > [cart]>Show Shopping Cart
> [cart]>Back To Search
> > > > > ------------------------------------------------------------- > 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://search.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://search.smithmicro.com/ John Butler

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:

Progress !! WAS: Trouble with formula.db (1997) WebCat2.0 [format thousands .0f] no go (1997) HELP WITH DATES (1997) [Way OT] Workstation Security (2002) WebCat B13 Mac CGI -- Frames question (1997) 2 easy questions re: [showif] and [sendmail] (1997) Not really WebCat- (1997) Problems passing [SKU] with $Replace in 2.0 (1997) Search crashing server (1998) Locking up with WebCatalog... (1997) 9 digit zip (2002) searching with groups (1997) [ShowIf] and empty fields (1997) Setting up shop (1997) [FoundItems] solved - thanks (1997) URGENT: NO BUG, woFIELDdata & FIELDword=ww (2002) Draft Manual, Tutorial, and more (1997) Why does WebCat do this? (2001) Re:Emailer and encryption (1997) Problem with updating to 2.1.1 (1998)