Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi
@ProjectPost.GetPropertyValue("content")
How can I use Truncate with the GetPropertyValue - because I want to shorten the text in my article overview page.
I've tried this without any luck:
@Umbraco.Truncate(@ProjectPost.GetPropertyValue("content"), 150, false)
/Sharmarke
Hi Sharmarke,
If you are using strongly typed Razor you can use this code
@Umbraco.Truncate(ProjectPost.GetPropertyValue("content").ToString(), 150, false)
If you are using dynamic Razor you should use this syntax
@Umbraco.Truncate(ProjectPost.content, 150, false)
Hope this helps,
/Dennis
You can also specify the return value after the .GetPropertyValue like this:
@Umbraco.Truncate(ProjectPost.GetPropertyValue<String>("content"), 150, false)
Hi Dennis
I used this one:
I have removed the "false" - to get the three dots.
Thanks again for your help!
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Truncating with GetPropertyValue
Hi
How can I use Truncate with the GetPropertyValue - because I want to shorten the text in my article overview page.
I've tried this without any luck:
/Sharmarke
Hi Sharmarke,
If you are using strongly typed Razor you can use this code
If you are using dynamic Razor you should use this syntax
Hope this helps,
/Dennis
Hi Sharmarke,
You can also specify the return value after the .GetPropertyValue like this:
/Dennis
Hi Dennis
I used this one:
I have removed the "false" - to get the three dots.
Thanks again for your help!
/Sharmarke
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.