Yeah, you're right of course. Can't believe =I didn't see that when I wrote it out. Anyway, Marc's solution of =two searches is what I'd do too.=
Terryp.s so you're saying that [showif anyvalue] will resolve =to true? No comparison needed? This is the first I'm hearing about this, =and I'm a pretty faithful and long-time reader of the list.
On Wed, 5 Aug 2009 10:40:07 -0500
Patrick =McCormick <pm@webdna.us> =wrote:
> Terry & Ki,
>
> I don't think that will =work because [instock] is only
>evaluated within the =[founditems] loop
>
> You need:
>
> [search =stuff...]
> [founditems]
> [hideif =[instock]]
> [item fields]
> =[/hideif]
> [/founditems]
> [/search]
>
> =BOOL is a really cool part of WebDNA. Anything greater
>than =zero is true and anything 0 or less is false. That
>means that =even random strings of text are, technically
>true. You need to =avoid bad code practice, but there
>are some really clever and =graceful things you can do.
>
> Be aware that something =like [showif [instock]=3D1] is
>the same as [showif [instock]] =as long as [instock] is
>greater than zero when an item is =actually in stock. It
>helps make the code a little bit more =readable, too.
>
>
>
>
> On Aug 4, =2009, at 1:39 PM, Terry Wilson wrote:
>
>> So you would =have two founditems loops within your =
>>search:
>>
>> [search =stuff...]
>>
>> [hideif [instock]=3D0]
>> =[founditems]
>> ...
>> [/founditems]
>> =[/hideif]
>>
>> [showif [instock]=3D0]
>> =[founditems]
>> ...
>> [/founditems]
>> =[/showif]
>>
>> [/search]
>>
>> =(sort by sku, not instock)
>>
>> =Terry
>>
>> Essentially, we want our product listing =page to do the
>>following:
>>
>> Group all =the items that are in stock first, out of
>>stock =second.
>> Within the in stock items, we want to sort by =SKU.
>>
>> Right now, since in stock is the actual =number in stock,
>>it is
>> sorting by actual =number, not just by what is in stock
>>and not in =
>> stock.
>>
>> -----------
>> Ki =Song
>>
>> On Tue, Aug 4, 2009 at 2:13 PM, Govinda =
>><<mailto:govinda.webdnatalk@gma=il.com
>> >govinda.webdnatalk@gmail.com<=/a>> wrote:
>>
>> Ki,
>>
>> I =don't think so.
>>
>> But with webdna you don't need =it either. If you are
>>not able to do
>> what you =want, then post the problem, someone will
>>surely guide you =
>> to the solution.
>>
>>
>> On Aug =4, 2009, at 12:07 PM, Ki Song - Knifecenter.com =
>>wrote:
>>
>> Is something like this =possible in a search context:
>>
>> =&asSKUsort=3D2&deON HANDsort=3D1&ON =HANDtype=3Dbool
>>
>> Can a data type be type boolean =in a search context?
>>
>> -----------
>> Ki =Song
>>
>>
>> ------------
>> John =Butler (Govinda)
>> <mailto:govinda.webdnatalk@gma=il.com>govinda.webdnatalk@gmail.com<=/a>
>>
>>
>>
>> =---------------------------------------------------------
>> =This message is sent to you because you are subscribed =
>>to
>> the mailing list
>><<mailto:talk@webdna.us>talk@webdna.us>.
>> To =unsubscribe, E-mail to:
>><<mailto:talk-leave@webdna.us>talk-leave@webdna.us =
>> >
>> archives:
>><http://mail.webdna.us/l=ist/talk@webdna.us>http://mail.webdna.us/l=ist/talk@webdna.us
>> old archives:
>><http://dev.webdna.us/TalkLi=stArchive/>http://dev.webdna.us/TalkLi=stArchive/
>>
>>
>> --
>> Terry =Wilson | terry@terryfic.com | http://terryfic.com
>> http://WhosComing.com - a simplified, =affordable online
>>reservation
>> =system
>> http://TightJacket.com -- stylish =protection for your
>>laptop
>> =--------------------------------------------------------------------------=
>> Attitude is the only difference between ordeal and =
>>adventure.
>> =---------------------------------------------------------
>> =This message is sent to you because you are subscribed =
>>to
>> the mailing list <talk@webdna.us>.
>> To =unsubscribe, E-mail to: <talk-leave@webdna.us>
>&=gt; archives: http://mail.webdna.us/l=ist/talk@webdna.us
>> old archives: http://dev.webdna.us/TalkLi=stArchive/
>
|
Yeah, you're right of course. Can't believe =I didn't see that when I wrote it out. Anyway, Marc's solution of =two searches is what I'd do too.=
Terryp.s so you're saying that [showif anyvalue] will resolve =to true? No comparison needed? This is the first I'm hearing about this, =and I'm a pretty faithful and long-time reader of the list.
On Wed, 5 Aug 2009 10:40:07 -0500
Patrick =McCormick <pm@webdna.us> =wrote:
> Terry & Ki,
>
> I don't think that will =work because [instock] is only
>evaluated within the =[founditems] loop
>
> You need:
>
> [search =stuff...]
> [founditems]
> [hideif =[instock]]
> [item fields]
> =[/hideif]
> [/founditems]
> [/search]
>
> =BOOL is a really cool part of WebDNA. Anything greater
>than =zero is true and anything 0 or less is false. That
>means that =even random strings of text are, technically
>true. You need to =avoid bad code practice, but there
>are some really clever and =graceful things you can do.
>
> Be aware that something =like [showif [instock]=3D1] is
>the same as [showif [instock]] =as long as [instock] is
>greater than zero when an item is =actually in stock. It
>helps make the code a little bit more =readable, too.
>
>
>
>
> On Aug 4, =2009, at 1:39 PM, Terry Wilson wrote:
>
>> So you would =have two founditems loops within your =
>>search:
>>
>> [search =stuff...]
>>
>> [hideif [instock]=3D0]
>> =[founditems]
>> ...
>> [/founditems]
>> =[/hideif]
>>
>> [showif [instock]=3D0]
>> =[founditems]
>> ...
>> [/founditems]
>> =[/showif]
>>
>> [/search]
>>
>> =(sort by sku, not instock)
>>
>> =Terry
>>
>> Essentially, we want our product listing =page to do the
>>following:
>>
>> Group all =the items that are in stock first, out of
>>stock =second.
>> Within the in stock items, we want to sort by =SKU.
>>
>> Right now, since in stock is the actual =number in stock,
>>it is
>> sorting by actual =number, not just by what is in stock
>>and not in =
>> stock.
>>
>> -----------
>> Ki =Song
>>
>> On Tue, Aug 4, 2009 at 2:13 PM, Govinda =
>><<mailto:govinda.webdnatalk@gma=il.com
>> >govinda.webdnatalk@gmail.com<=/a>> wrote:
>>
>> Ki,
>>
>> I =don't think so.
>>
>> But with webdna you don't need =it either. If you are
>>not able to do
>> what you =want, then post the problem, someone will
>>surely guide you =
>> to the solution.
>>
>>
>> On Aug =4, 2009, at 12:07 PM, Ki Song - Knifecenter.com =
>>wrote:
>>
>> Is something like this =possible in a search context:
>>
>> =&asSKUsort=3D2&deON HANDsort=3D1&ON =HANDtype=3Dbool
>>
>> Can a data type be type boolean =in a search context?
>>
>> -----------
>> Ki =Song
>>
>>
>> ------------
>> John =Butler (Govinda)
>> <mailto:govinda.webdnatalk@gma=il.com>govinda.webdnatalk@gmail.com<=/a>
>>
>>
>>
>> =---------------------------------------------------------
>> =This message is sent to you because you are subscribed =
>>to
>> the mailing list
>><<mailto:talk@webdna.us>talk@webdna.us>.
>> To =unsubscribe, E-mail to:
>><<mailto:talk-leave@webdna.us>talk-leave@webdna.us =
>> >
>> archives:
>><http://mail.webdna.us/l=ist/talk@webdna.us>http://mail.webdna.us/l=ist/talk@webdna.us
>> old archives:
>><http://dev.webdna.us/TalkLi=stArchive/>http://dev.webdna.us/TalkLi=stArchive/
>>
>>
>> --
>> Terry =Wilson | terry@terryfic.com | http://terryfic.com
>> http://WhosComing.com - a simplified, =affordable online
>>reservation
>> =system
>> http://TightJacket.com -- stylish =protection for your
>>laptop
>> =--------------------------------------------------------------------------=
>> Attitude is the only difference between ordeal and =
>>adventure.
>> =---------------------------------------------------------
>> =This message is sent to you because you are subscribed =
>>to
>> the mailing list <talk@webdna.us>.
>> To =unsubscribe, E-mail to: <talk-leave@webdna.us>
>&=gt; archives: http://mail.webdna.us/l=ist/talk@webdna.us
>> old archives: http://dev.webdna.us/TalkLi=stArchive/
>
DOWNLOAD WEBDNA NOW!
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...