Re: to template or not
On Thu, 26 Feb 2004 18:27:21 +0100, "rush" <pipa@rush.aval on.hr> wrote:
[color=blue]
>"Stephen Poley" <sbpoleySpicedH amTrap@xs4all.n l> wrote in message
>news:oj3s30tmv o8sgs5a9rcc25il 1cs4bs6vni@4ax. com...
>[color=green]
>> Suppose you have a page which has to display a variable-length list of
>> products. If the length is zero, it puts up a paragraph along the lines
>> of "no products currently available in this category".
>>
>> How do you do that in a template which includes no code?[/color][/color]
[color=blue]
>html/prodlist.html:
><html>
><body>
><h1>Phone MegaStore Special</h1>
>
><!--NAME:ONEPRODUCT-->
>Product Name:{PRODNAME} price: {PRODPRICE}<br> <hr>
><!--END:ONEPRODUCT-->
>
><!--NAME:NOPRODUCTS-->
>Sorry no products found ...
><!--END:NOPRODUCTS-->[/color]
OK, I get the general idea, thanks.
I think on the whole I'd just as soon as have something like:
<?php if ($products==0): ?>
Sorry ...
<?php endif ?>
but I can see some people might just prefer your version.
--
Stephen Poley
On Thu, 26 Feb 2004 18:27:21 +0100, "rush" <pipa@rush.aval on.hr> wrote:
[color=blue]
>"Stephen Poley" <sbpoleySpicedH amTrap@xs4all.n l> wrote in message
>news:oj3s30tmv o8sgs5a9rcc25il 1cs4bs6vni@4ax. com...
>[color=green]
>> Suppose you have a page which has to display a variable-length list of
>> products. If the length is zero, it puts up a paragraph along the lines
>> of "no products currently available in this category".
>>
>> How do you do that in a template which includes no code?[/color][/color]
[color=blue]
>html/prodlist.html:
><html>
><body>
><h1>Phone MegaStore Special</h1>
>
><!--NAME:ONEPRODUCT-->
>Product Name:{PRODNAME} price: {PRODPRICE}<br> <hr>
><!--END:ONEPRODUCT-->
>
><!--NAME:NOPRODUCTS-->
>Sorry no products found ...
><!--END:NOPRODUCTS-->[/color]
OK, I get the general idea, thanks.
I think on the whole I'd just as soon as have something like:
<?php if ($products==0): ?>
Sorry ...
<?php endif ?>
but I can see some people might just prefer your version.
--
Stephen Poley
Comment