Miva Merchant 4 Module FAQs » Search Manager (BROK_SEARCH)


I would like to conditionally display text on the search page. How can I do that?

(2003/08/08)I added the tokens %begin_if|expression|%...%end_if% and %begin_notif|expression|%...%end_notif% which will display their contents only if the expression evaluates to true. So, for example, if you wanted to pass a variable to the search page (perhaps by adding &Variable=1 to the url) and display text on the search page only if that variable (in this example, we'll call it Variable) was set to be equal to 1, then you could add this to your main template:

%begin_if|g.Variable EQ 1|%
This text displays only if the Variable is 1

Similarly, you can display text if the Variable is NOT 1 with:

%begin_notif|g.Variable EQ 1|%
This text displays only if the Variable is NOT 1

of course this can also be done with the %begin_if| token:

%begin_if|NOT (g.Variable EQ 1)|%
This text displays only if the Variable is 1

A: I added this feature in a recent upgrade (version 4.88 compiled, 4.88 uncompiled). The %var| token will can now evaluate and display an expression or variable. For example, to display the price - cost for a product you would use a token of the sort:

%var|Products.d.price - Products.d.cost|%

With that upgrade I also modified the conditional tokens %begin_if| and %begin_notif| to be able to evaluate expressions. So if, for example, you wanted to display text only if the product has weight of 3, you could use:

%begin_if|Products.d.weight EQ 3|%
This product has a weight of 3!

Last update: 2005-01-12 08:49
Author: Support
Revision: 1.0

Print this record Send FAQ to a friend Show this as PDF file
Please rate this FAQ:

Average rating: 0 out of 5 (0 Votes )

completely useless 1 2 3 4 5 most valuable

You cannot comment on this entry

Records in this category