Macro expressions

Macros are text expressions that the system evaluates and converts into values. By using macros, you can create dynamic website content and in general configure the application to perform different actions under different conditions. Macros range from simple expressions for loading values from data in the system, to complex sets of instructions that lead to a certain result.

Learn the macro syntax

Kentico uses a macro language (K#) with a wide range of syntax options and features.

Enter macro expressions in the system

Learn where in the Kentico user interface you can enter macro expressions, and about the available assistance features.

Write macro conditions

One of the most common ways to leverage macros is to define dynamic conditions for various types of functionality.

Find information about macro methods

The system provides a large number of methods that you can call in macro expressions. View this reference to learn about the available methods.

Troubleshoot macros

If you encounter problems when working with macro expressions, the system provides several tools that can help identify and fix the issues:

Extend the macro engine

If the default functionality of the macro engine does not cover all of your requirements, developers can extend the macro engine.

Learn to create custom:

Macro expressions on MVC sites

When working with the MVC development model, usage of macros is fully supported for the administration interface and for all processes that run within the Kentico application (for example marketing automation processes or recalculation of contact scores).

However, macros are not automatically resolved when displaying page content on your MVC site. If you wish to use macros within page content, you need to manually resolve the macros using the API before you render the data on the live site.