Skip to main content

ActiveMember360 Shortcodes

ActiveMember360 has its own comprehensive set of shortcodes that can be categorised into these types for clarity:

All ActiveMember360 shortcodes are specified in lowercase, and always start with mbr_ followed by a unique shortcode identifier e.g. [mbr_logout_url]

All ActiveMember360 shortcodes can operate with start and end tags. However, most end tags are unnecessary especially for display shortcodes.

Notably ActiveMember360 has it's own proprietary shortcode processor.

This allows relevant ActiveMember360 shortcodes to be supported and expanded within:

  • The content of a Post, Page, or custom post type
  • The title of a Post, Page, or custom post type
  • Excerpts
  • WordPress Widgets
  • WordPress Menu items
  • WordPress Block Editor and many third party page builders

ActiveMember360 Shortcode Types

Display Shortcodes

The ActiveMember360 display shortcodes are typically of the form [mbr_*] where * is the generic type of information to display. Most display shortcodes use parameters to define the display of specific data.

For example:

[mbr_contact field="email"]

There is a special form of display shortcode that is specifically designed to operate without the use of parameters.

Examples of these shortcodes are:

[mbr_db_email]

[mbr_db_id]

The standard form for these being:

[mbr_contact field="email"]

[mbr_contact field="id"]

respectively.

Whilst this provides a useful short form definition it exists primarily to allow certain shortcodes to be used with other third party plugins that normally prevent the use of shortcodes containing parameters, or special characters such as single and double quotes.

For a full list of display shortcodes visit ActiveMember360 Display Shortcodes.

Conditional Shortcodes

The ActiveMember360 conditional shortcodes typically perform a conditional test resulting in either a true or false result.

To support the true/false condition, i.e. if/else, ActiveMember360 introduces an additional shortcode tag [ELSE_*], where * is the shortcode identifier. This supports what is called shortcode branching.

Conditional shortcodes allow you to either control the display of specific content on the post/page or the execution of other shortcodes depending upon the result of a conditional test.

They are normally of the form [mbr_is_*] or [mbr_not_*].

However please note that not all [mbr_is_*] have the logical opposite e.g. [mbr_not_*]

Most ActiveMember360 conditional shortcodes can be used in three different ways:

  • If the test is true i.e. the logged in contact has the primary CRM tag with id 123 display ‘Content only for those with tag 123’.

    [mbr_is_for tags="123"]
    <p>Content only for those with tag 123</p>
    [/mbr_is_for]
  • If the test is false i.e. the logged in contact does not have the primary CRM tag with id 123 display ‘Content only for those without tag 123’.

    [mbr_is_for tags="123"]
    [ELSE_is_tag]
    <p>Content only for those without tag 123</p>
    [/mbr_is_for]
  • If the test is true i.e. the logged in contact has the primary CRM tag with id 123 display ‘Content only for those with tag 123’, else if the test is false i.e. the logged in contact does not have the primary CRM tag with id 123 display ‘Content only for those without tag 123’.

    [mbr_is_for tags="123"]
    <p>Content only for those with tag 123</p>
    [ELSE_is_tag]
    <p>Content only for those without tag 123</p>
    [/mbr_is_for]

For a full list of conditional shortcodes visit ActiveMember360 Conditional Shortcodes.

Recommendation

We would always recommend using ActiveMember360 Conditionals in preference to many of the ActiveMember360 conditional shortcodes. Conditionals provide the greatest flexibility regarding the conditions available to control the display of content.

They are detailed at Conditionals.

Action Shortcodes

The ActiveMember360 action shortcodes typically perform an action on your website.

For example [mbr_update_contact assign_tags="123"]. This will apply tag 123 to the current logged in contact.

The action shortcodes are named by an action.

So they may be of the form for example:

[mbr_redirect]

[mbr_automation]

For a full list of action shortcodes visit ActiveMember360 Action Shortcodes.

Module Shortodes

For a full list of shortcodes available for ActiveMember360 Modules visit ActiveMember360 Module Shortcodes.

Extension Shortcodes

For a full list of shortcodes available for ActiveMember360 Extensions visit ActiveMember360 Extension Shortcodes.

ActiveMember360 Shortcode Nesting

Sometimes for example when using the ActiveMember360conditional shortcodes you need to run multiple conditional tests to decide which content to display. This often requires placing one shortcode inside of another i.e. between the other shortcode’s start and end tag. This is called shortcode nesting.

To nest a shortcode simply add a number to the end of the shortcode name. Similarly, for the ELSE_ and the closing shortcode tag.

ActiveMember360 supports nesting up to 19 levels deep.

If a subsequent shortcode commences after the previous shortcode is closed you don’t need to use the nesting ability.

An example of nesting:

[mbr_is_for tags="123"]
<p>Content only for those with tag 123</p>
[ELSE_is_tag]
[mbr_is_for1 tags="456"]
<p>Content only for those with tag 456 but without tag 123</p>
[ELSE_is_tag1]
[mbr_is_for2 tags="789"]
<p>Content only for those with tag 789 but without tags 123 and 456</p>
[ELSE_is_tag2]
<p>Content only for those without tags 123, 456 and 789</p>
[/mbr_is_for2]
[/mbr_is_for1]
[/mbr_is_for]

An example where nesting is not required:

[mbr_is_for tags="123"]
<p>Content only for those with tag 123</p>
[/mbr_is_for]
[mbr_is_for tags="456"]
<p>Content only for those with tag 456</p>
[/mbr_is_for]

ActiveMember360 Embedded Shortcodes

The ActiveMember360 shortcode processor uniquely supports the use of embedded shortcodes.

Embedded shortcodes differ from nestable shortcodes.

An embedded shortcode is one specified within the attribute/parameter of another shortcode.

As an example:

[mbr_compare value1="[mbr_contact field='numberofvisits']" cmp="GT" value2="1"]
<p>Welcome back.</p>
[/mbr_compare]

When embedding shortcodes that have their own parameters you must take care to ensure the parameter delimiters are matched using the single and double quotes.

Again the example:

[mbr_compare value1="[mbr_contact field='numberofvisits']" cmp="GT" value2="1"]
<p>Welcome back.</p>
[/mbr_compare]

would be correct.

However:

[mbr_compare value1="[mbr_contact field="numberofvisits"]" cmp="GT" value2="1"]
<p>Welcome back.</p>
[/mbr_compare]

would be incorrect and fail.

Evaluation Order

When using ActiveMember360 shortcodes in an embedded scenario it is often a requirement that the shortcodes are evaluated in a specific order.

To control the order of shortcode processing ActiveMember360 uses two types of shortcode delimiters.

In addition to the standard set of square brackets [ ] ActiveMember360 also uses a set of bracket and pipe symbols (| |)

For ActiveMember360 (| |) delimited shortcodes will be evaluated before [ ] delimited shortcodes.

An example of this would be:

[mbr_redirect url= "(|mbr_permalink post_id='123'|)"]

The power of supporting embedded shortcode processing should not be underestimated.