News:FirstXChar
Version: - stringSummary
Returns the first X
characters of the current news item main text or teaser text, without tags.
Settings
The value is generated automatically based on the news item main text or teaser text.
(Modules tab > News > Category > News > Text/Settings > Teaser/Text)
Remarks
Whether to display the first X characters of either the news item main text or the teaser text is configured through the paragraph settings (General panel > Show first ... character
).
Examples
Outputting the template tag
@GetString("News:FirstXChar")
Check if tag has a value
@if(!string.IsNullOrWhiteSpace(GetString("News:FirstXChar"))) {
@* Tag has value, so let's do something useful here. *@
}
Assign tag to a value for later use
@{
string storedTag = GetString("News:FirstXChar");
}
Outputting the template tag
<!--@News:FirstXChar-->
Check if string has a value
<!--@If Defined(@News:FirstXChar)-->
Let's output this tag here: <strong><!--@News:FirstXChar--></strong>
<!--@EndIf(@News:FirstXChar)-->