PDA

View Full Version : need list of OpenUI variables - conditional for related items


gordon_moe
06-29-06, 03:46 PM
I think I can use this conditional in VC Cat. Page Templates to achieve my goal below (posted previously). I need to know the "variable" for "has a related item??!" so I can try the method below as spec'd by VC CPT docs.

<VARIABLES>
%begin_if|variable|%...%end_if%
: displays contents only if the variable evalutes to TRUE
%begin_notif|variable|%...%end_notif%
: displays contents only if the variable evaluates to FALSE


(GOAL) --- posted earlier ---

On my Category template I have a listing of products.

As part of this listing I want to put a text link that only appears if the product has Related Items assigned to it. Something like:

%begin_hasrelated_items%
<a href = "link to product detail%prodcode%">View related items</a>
%end_hadrelated_items%

My guess is that I can do it with a "non-Viking" or OpenUI token, but I am unsure.

I'm thinking it will look something like
%begin_if|Products.d.image|%
...
%end_if%

Thanks in advance.

Bruce - PhosphorMedia
06-29-06, 04:55 PM
I don't think that there is a "has related product" token. However, you should be able to use

%IF(RelatedProducts.d.product_id)%
this product has a related product
%ELSE%
it does not
%IFEND%

in the Related Products box of the Category Template

gordon_moe
06-29-06, 06:57 PM
Awesome,

Bruce that worked like a dream. Thank you.

For the archive - I put %OUI% at the top of the Main Template.

Gordon