MiniVend Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

Re: [mv] problems with [if...] tags



At 03:46 PM 11/17/1999 , you wrote:
>******    message to minivend-users from 
>c-wheeler@c-wheeler.agelena.net     ******
>
>I am unable to get [if...] tags to work in minivend.
>Here's an example:
>
>.html code
>
>                       <p>combo = "[item-field combo]"</p>
>                 [if-field combo]
>                       <p>true</p>
>                 [else]
>                       <p>false</p>
>                 [/else]
>                 [/if-field]
>
>output when combo eq ""
>
>combo = ""
>
>[if-data products combo]    (why is this printed?)
>
>true
>
>
>output when combo ne ""
>
>combo = "w103505 w103506 w103507 w103508"
>
>[if-data products combo]
>
>true
>
>
>output when combo == 0
>
>combo = "0"
>
>[if-data products combo]
>
>true
>
>The conditional evaluates to true no matter what the value
>of the string. I have tried all the other possibilities I
>can think of after reading the docs and looking at the demo
>with the same result.

         That's essentially a PERL situation -- if a string has contents it 
is considered true.  If it is empty, the condition should fail and print false.

         Here's how I was able to test for a specific field contents:

[if explicit]
[condition]
         $currently = '[item-code]';
         return 1 if $currently eq "11-20";
         return 0;
[/condition]
Does not contain salt.
[else]
Salt-impregnated using a patented process.
[/else]
[/if]


Here's just a plain-Jane, if the field has contents, do something:

[if-field color]
Color:[item-accessories color]
[else]
Available in Puke Green only.
[/else]
[/if-field]


If you're looking into another database:

[loop search="fi=articles.asc/sf=product/se=[item-code]/ml=12/co=yes"]
Related article: <A HREF="[loop-data articles url]" 
TARGET=inside>[loop-data articles title]</A><BR>
[/loop]

This code grabs all references to the current item-code in a db called 
articles.  If the search returns no matches the contents are not 
displayed.  If you're pulling a field with multiples of data in it 
(separated by comma, or space, or whatever) you could [loop] with it to 
pull out the individuals.

>Thanks,
>
>David
>-
>To unsubscribe from the list, DO NOT REPLY to this message.  Instead, send
>email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
>Archive of past messages: http://www.minivend.com/minivend/minivend-list


Ryan Hertz                                              tel  800-645-BAIT
Webmaster                                               fax  520-645-2588
Advertising Director                            http://www.insideline.net
Gary Yamamoto Custom Baits, Inc.            http://www.yamamoto.baits.com



Search for: Match: Format: Sort by: