Share This
 
All Posts  /  Kentico Development Tips  /  August 04, 2015 

A Brief Tutorial on Macros (K#)

Kentico has a plethora of features available to make creating and editing sites easier and faster. In this post I will review the macro autocomplete feature, a shortcut for inserting macros into fields & text areas, and the various places you can use macros.

In editable text areas on the Page view tab you can view a list of macro options by clicking on the insert macro icon {#}.

Macro Icon

This will open the Insert Macro dialog which shows a tree listing available options. 

Macro Option Tree

In addition, by clicking the code tab you can write the macro expression and take advantage of the autocomplete feature. If the autocomplete disappears or doesn’t open automatically, try pressing Ctrl + Shift + Space.

Macro Autocomplete

The macro can be manipulated using operators, methods, conditions, iterations and entered inline with the rest of the content in the editable region

Inline Macro

Macros can also be used in areas where the Macro Arrow icon is present. This includes web parts and default form field values.

For example, a macro can be used to get a dynamic value to set the visibility of a web part:

Kentico Web Part Visibility
 

Or to grab a parameter from the url to create a dynamic where condition:

Macro Where Query
 
You can learn more about Macros in the kentico documentation:
Entering Macro Expressions
Macro Syntax
Show More
Share This
 
Comments
Blog post currently doesn't have any comments.
*
 Security code
*
ADD COMMENT
Social Buzz

Get in Touch

Contact

Contact
t: 973.539.5255
f: 973.917.4730

Visit

Visit
715 Main Street
Boonton, NJ 07005

Locations

Locations
Boonton
Dallas
Jersey City
Boulder

Send Us a Message




 Security code