Based on the snippet you've provided I'd say the only thing wrong is that newsCategoryItemContent has single quotes around it - which just means that *that* is the string that'll be truncated (although only at the 200th character but the string is not that long...)
If the value you need truncated is in the newsCategoryItemContent property you need to omit the quotes and maybe you need $currentPage too, depending on the context, e.g.:
It's actually not XSLT's fault - it's more of an Umbraco thing that they've chosen not to display the error messages on a frontend facing page.
You can try adding ?umbDebugShowTrace=True to the URL, which should give you a lot more information - if you scroll down you should see some text in red at some point; there should be some more information about the specific error.
umbraco.library.TruncateString bug?
Hello,
i am using umbraco 4.7 and when i use the TruncateString method it wont accept it and generate an error.
I am creating the code even through the wizard and the end result is:
<xsl:value-of select="umbraco.library:TruncateString('newsCategoryItemContent', '200', '...')" disable-output-escaping="yes"/>
I realy dont get it.
Hi Matias,
Based on the snippet you've provided I'd say the only thing wrong is that newsCategoryItemContent has single quotes around it - which just means that *that* is the string that'll be truncated (although only at the 200th character but the string is not that long...)
If the value you need truncated is in the newsCategoryItemContent property you need to omit the quotes and maybe you need $currentPage too, depending on the context, e.g.:
You say that you get an error - what does it say?
/Chriztian
there is still an error without single quotes.It just say that there is an error. I hate xslt for that, that there is no error msg.
Hi Matias,
It's actually not XSLT's fault - it's more of an Umbraco thing that they've chosen not to display the error messages on a frontend facing page.
You can try adding ?umbDebugShowTrace=True to the URL, which should give you a lot more information - if you scroll down you should see some text in red at some point; there should be some more information about the specific error.
/Chriztian
I know it is umbraco.. i have found the solution and the error msg was that umbraco.library wasn't defined, because i have made a variable.
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:umb="urn:umbraco.library">
Which will make that command look like this:
<xsl:value-of select="umb:TruncateString(newsCategoryItemContent, '800', '...')" disable-output-escaping="yes"/>
is working on a reply...