Documentation > CMS Template API Library > OutputContext > UserVariables

UserVariables

A place to store data as key value pairs to retrieve later. Can be shared when calling other templates with Asset.Show, Asset.GetLink, and by a Wrapper as long as all templates involved are C#.

Type

CrownPeak.CMSAPI.UserVariables

Code Example

C#

Sample:
 
             
             
             // Store
             context.UserVariables["myvalue"] = "foo";
             
             // Read
             string myStoredValue = context.UserVariables["myvalue"];
            

Connect with Crownpeak