Anyone here that can help me? I have the following code:
@inherits umbraco.MacroEngines.DynamicNodeContext
@{
var node = @Model.NodeById(1257);
}
Newest
@foreach (var article in node.Descendants().Where("Visible && (NodeTypeAlias = \"Article\" || NodeTypeAlias = \"sergrein\" || NodeTypeAlias = \"solomyndagrein\")").OrderBy("createDate desc").Take(10))
{
@article.createDate.ToString("dd/MM") | @article.title
}
What I want is: if @article.title is longer than e.g. 10 characters, it needs to return the 10 characters followed by ... (for example: "this_is_a_..."). If the @article.title is shorter than 10 characters, it can just show the full title length.
How can this truncating be done?