I have a field called 'description' on my structured pages in Kentico 11 and I want to count the number of characters in the string.
I tried something like this but it didn't work. Any ideas?
{% If (description.count=>60) { "description is equal to or greater than 60" } else { "description is less than 60" } %}
You need to use length - like {%FieldName.Length%} - just keep in mind that it also counts HTML tags, so maybe you want to strip HTML from the field's value first.
Perfect thanks.
Also how would I do the following in ascx.
if(FileName.Length>=60) {"title=\"" + FileName + "\""}
Sorry I am such a newb. Just trying to grasp this whole thing.
hey everyone, the ascx variation to my the code above is:
<%# If((Eval("FileName").ToString().Length >= 60 ), true, false) %>
Please, sign in to be able to submit a new answer.