MiniVend Akopia Services

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

Re: [mv] PERL: Interpolate question



Thanks very much for your help with that. I did some more head-banging, and I 
believe I can focus my question...

When, in embedded Perl, on a flypage, I access a field, called 'limited'...
[perl interpolate=1]
  $string = [item-field limited];
  $string .= " is the value.";
  return $string;
[/perl]

The code does what you would expect IF the field is not blank. (e.g., YES is 
the value.) But, if the field happens to be blank, none of the code between 
the Perl tags gets executed! This is an effect I have reproduced a number of 
different ways now. I noted in the documentation that "a few tags can't be 
used with safe_tag, notably ones accessing a database that has not previously 
been accessed on the page." But, on this page, the products database is 
accessed twice before the [perl] tags, as follows:
There is, for the page title,"<TITLE>[item-description]</TITLE>" and also, at 
the top of the , "<strong>[item-field item] - [item-code]</strong>"

I have not found any other info on this phenomenon. Anyone with a solution 
(or who will give me a dopey slap and straighten me out)? For now, I'll just 
make sure none of my fields are blank....

Thanks very much,
Rob Maurer
 
In a message dated 10/12/99 9:47:18 AM Eastern Daylight Time, ant@maine.com 
writes:

> ******    message to minivend-users from "Mr. Anthony R.J. Ball" <ant@maine.
> com>     ******
>  
>  > [perl interpolate=1]
>  > $output = '';
>  > 
>  >   $output .= qq(\n\t<td width="50%">) . qq([order [item-code]]);
>  >   $output .= qq([Unable to display image][/order]</td>);
>  >   $output .= qq(\n\t<td width="50%">) . qq([order [item-code]]) . qq([
> Unable 
>  > to display image]) . qq([/order]) . qq(</td>);
>  
>  Here... all of your text is withing minivend [] braces... try it without 
> them...
>  MV might be clobbering the values... not sure...
>  
>  
>  > if ((qq([item-field limited]) eq "yes") && ([item-field availablenum] < 
1))
>  {
>  >   $output = '';
>  >   $output .= qq(<td width="50%"><center><strong>);
>  >   $output .= qq();
>  >   $output .= qq(Not available.</strong></center></td>);
>  >   $output .= qq(<td width="50%"><center><strong>);
>  >   $output .= qq();
>  >   $output .= qq(Item is sold.</strong></center></td>);
>  >   }
>  > elsif (qq([item-field limited]) eq "yes") {
>  
>  here you need a $output = ''; or you'll get the first part and this part
>  
>  >   $output .= qq(\n\t</tr><tr><td width="100%" colspan="2">);
>  >   $output .= qq(<center><strong>);
>  >   $output .= "Only " . "[item-field availablenum]" . " available!";
>  >   $output .= qq(</strong></center></td>);
>  >   }
>  > 
>  > return $output;
>  > [/perl]
>  
>     It's also possible your tables are wrong so your info doesn't show even 
>  though it's there. Have you viewed the source of the outputted page?
>  
>  Hope something here helps!           - Ant
>  
>  -- 
>  
>  Anthony Ball                                                ant@maine.com
>  MaineStreet Communications, Inc        208 Portland Road, Gray, ME  04039
>  tel:1.207.657.5078         fax:1.207.657.5048       http://www.maine.com/
>  -


Search for: Match: Format: Sort by: