FieldName

Version: - string  

Summary

Returns the name of the custom field.

Settings

The value is based on the Name field in the news custom field settings.

(Management Center > Control Panel > News > Edit Custom fields -> Custom field -> Name)

Examples

Outputting the template tag

@GetString("FieldName")
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Check if tag has a value

@if(!string.IsNullOrWhiteSpace(GetString("FieldName"))) {
@* Tag has value, so let's do something useful here. *@
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Assign tag to a value for later use

@{
string storedTag = GetString("FieldName");
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Outputting the template tag

<!--@FieldName-->
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Check if string has a value

<!--@If Defined(@FieldName)-->
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX