SmartTag equations are used to allow for more complex comparisons within a single attribute of a MemberMouse SmartTag. Here's an example of a SmartTag equation:


[MM_Member_Decision hasBundle='3|4']
This content will only be displayed if the current member 
has the bundle with ID 3 or 4 applied to their account.
[/MM_Member_Decision]



There are currently two different SmartTag equation versions, the legacy format of 2.0 and the new, recommended format of 2.1. Read this article to learn how to set your SmartTag version.


SmartTags 2.1


In the following examples, we'll use the MM_Member_Decision SmartTag to demonstrate how to use the SmartTag 2.1 equations.


For attributes that support SmartTag equations you can:


  1. Use the | character to indicate an OR relationship:


    [MM_Member_Decision membershipId='1|2']


    This equation will be true if the member has the membership with IDs 1 OR 2.


  2. Use the & character to indicate an AND relationship:


    [MM_Member_Decision hasBundle='4&7']


    This equation will be true if the member has bundles with IDs 4 AND 7.


  3. Precede IDs with a ! to indicate that it should check if the member does not have that ID:


    [MM_Member_Decision membershipId='!5']


    This equation will be true if the member does not have the membership with ID 5.


  4. Use parentheses to control the order in which parts of the equation are executed:


    [MM_Member_Decision hasBundle='!1|2']


    This equation will be true if the member does not have the bundle with ID 1 OR does have the bundle with ID 2.


    [MM_Member_Decision hasBundle='!(1|2)']


    This equation will be true if the member does not have the bundle with ID 1 OR the bundle with ID 2.


Let's look at more involved examples:


[MM_Member_Decision hasBundle='(1|2)&!3']


This means, show the content contained in the tag if...


the current member has bundles with IDs 1 OR 2

AND

the member does not have the bundle with ID 3

If you use multiple attributes for a single decision, it results in an AND relationship. For example, if you write:


[MM_Member_Decision membershipId='1' hasBundle='4']


This means, show this content if...


the current member's membership equals 1

AND

the current member has the bundle with ID equal to 4



SmartTags 2.0 (Legacy)


In the following examples, we'll use the MM_Member_Decision SmartTag to demonstrate how to use the SmartTag 2.0 equations.


Attributes that support SmartTag equations can accept values in the following formats:

  1. A single ID to specify a single value:

    [MM_Member_Decision membershipId='1']
  2. A comma-delineated list of IDs to specify two or more values:

    [MM_Member_Decision hasBundle='2,5,8']

  3. Preceding IDs with a '-' indicates that it should check if the member does not have that ID:

    [MM_Member_Decision membershipId='-5']

Providing multiple IDs results in an OR relationship. For example if you write:


[MM_Member_Decision membershipId='1,2,-3']


This means, show the content contained in the tag if...


the current member's membership equals 1 OR equals 2 OR does not equal 3


If you use multiple attributes for a single decision, it results in an AND relationship. For example, if you write:


[MM_Member_Decision membershipId='1' hasBundle='4']


This means, show this content if...


the current member's membership equals 1

AND

the current member has the bundle with ID equal to 4