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
I am using some code for paging on a portfolio page that calls all my portfolio items.
Currently I have to use the followign code to display sections of portfolio items:
@item.GetPropertyValue("PortfolioItemTitle")
Is there a way for me to truncate this? I could do with the first 100 characters of a portfolio item.
Why do you ask, the answer is in the title? ;-)
@(Umbraco.Truncate(item.GetPropertyValue("PortfolioItemTitle"), 100, false).ToString());
Not sure if ToString() is necessary.
@(Umbraco.Truncate(item.GetPropertyValue("PortfolioItemBodyText").ToString(), 100, false))
This worked for me :)
Not that if you have HTML in the title you will want to strip that as well:
@(Umbraco.Truncate(Umbraco.StripHtml(item.GetPropertyValue("PortfolioItemBodyText").ToString()), 100, false))
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Umbraco.Truncate
I am using some code for paging on a portfolio page that calls all my portfolio items.
Currently I have to use the followign code to display sections of portfolio items:
@item.GetPropertyValue("PortfolioItemTitle")
Is there a way for me to truncate this? I could do with the first 100 characters of a portfolio item.
Why do you ask, the answer is in the title? ;-)
Not sure if ToString() is necessary.
@(Umbraco.Truncate(item.GetPropertyValue("PortfolioItemBodyText").ToString(), 100, false))
This worked for me :)
Not that if you have HTML in the title you will want to strip that as well:
@(Umbraco.Truncate(Umbraco.StripHtml(item.GetPropertyValue("PortfolioItemBodyText").ToString()), 100, false))
is working on a reply...