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
Hello friends, I have been breaking my head with this. What I need is to find a word in a text string. For example:
searching for "people" in "hello people, good morning."
In php this is easy:
<? php strstr($string, $word); ?>
But in Xslt Umbraco I have not found anything. Help please!
Hi umbracocool,
You use the contains() function for that, e.g.:
<!-- Grab the site root --> <xsl:variable name="siteRoot" select="$currentPage/ancestor-or-self::*[@level = 1]" /> <!-- Find nodes containing a specific string in the nodeName attribute --> <xsl:variable name="foundNodes" select="$siteRoot//*[@isDoc][contains(@nodeName, 'people')]" /> <xsl:template match="/"> <xsl:apply-templates select="$foundNodes" /> </xsl:template> <xsl:template match="*[@isDoc]"> <p> <xsl:value-of select="@nodeName" /> </p> </xsl:template>
/Chriztian
Hey brother, you saved my life, thank you very much, you're a genius, was crazy looking for this and could not find it. God bless you, Bye!
sorry brother, but a problem has arisen, and is not case sensitive. I mean if I look, pro example:
"john" to "JOHN is a Man".
It works for me! What do I do?
Ok brother, hehe using lowercase.Thank you!
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Search word in a text string
Hello friends, I have been breaking my head with this. What I need is to find a word in a text string. For example:
searching for "people" in "hello people, good morning."
In php this is easy:
But in Xslt Umbraco I have not found anything. Help please!
Hi umbracocool,
You use the contains() function for that, e.g.:
/Chriztian
Hey brother, you saved my life, thank you very much, you're a genius, was crazy looking for this and could not find it. God bless you, Bye!
sorry brother, but a problem has arisen, and is not case sensitive. I mean if I look, pro example:
"john" to "JOHN is a Man".
It works for me! What do I do?
Ok brother, hehe using lowercase.Thank you!
is working on a reply...