Changing "lowercase" into "uppercase" makes all the characters capitalized. I just want the first letter to be capitalized. Is this possible and more important, how is this possible.
The data is purposely stored in UPPERCASE , so I thought I would lower it first. and then apply the style. I also tried removing the field case attribute, but it didn't work either.
When you insert it gives you a choice of none, lower or upper only.
Maybe you'll need to create an XSLT macro to be able to return the text in lowercase then. In the Exslt extensions there is a lowercase() method, which you should be able to use. Once this is done you should be able to capitalize it.
How to create capitals with EXSLT
Hi,
I am trying to put the first letter of a menu item in capital. Right now alle the characters are lowercase. But I can't find out how to do this.
I think it's in this line;
<h2><xsl:value-of select="Exslt.ExsltStrings:lowercase($level2Page/menuTitle)"/></h2>
Changing "lowercase" into "uppercase" makes all the characters capitalized. I just want the first letter to be capitalized. Is this possible and more important, how is this possible.
The entire code is;
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> ]>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxml="urn:schemas-microsoft-com:xslt"
xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets"
exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets ">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<xsl:template match="/">
<xsl:variable name="level2Page" select="$currentPage/ancestor-or-self::* [@level=2]"/>
<h2><xsl:value-of select="Exslt.ExsltStrings:lowercase($level2Page/menuTitle)"/></h2>
<xsl:if test="count($level2Page/* [@isDoc and string(umbracoNaviHide) != '1'])">
<ul>
<xsl:for-each select="$level2Page/* [@isDoc and string(umbracoNaviHide) != '1']">
<li>
<!-- check voor actief submenu -->
<xsl:if test="./@id = $currentPage/@id">
<xsl:attribute name="class">active</xsl:attribute>
</xsl:if>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="./menuTitle"/>
</a>
</li>
<xsl:for-each select="./* [@isDoc and string(umbracoNaviHide) != '1']">
<li>
<!-- check voor actief submenu -->
<xsl:attribute name="class">
<xsl:text>submenu</xsl:text>
<xsl:if test="./@id = $currentPage/@id">
<xsl:text> active</xsl:text>
</xsl:if>
</xsl:attribute>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="./menuTitle"/>
</a>
</li>
</xsl:for-each>
</xsl:for-each>
</ul>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
Thanks!
Hi Michiel,
Have you tried to just output the plain value to the tag and then capitalize it with CSS?
XSLT:
CSS:
/Chriztian
Sometimes things are just to easy.
Thanks!!
Tried using this method for an umbraco field and it isn't working.
<title id="BrowserPageTitle">Honey Baked Ham<umbraco:Item field="pageTitle" insertTextBefore=" - " case="lower" runat="server"></umbraco:Item></title>
The data is purposely stored in UPPERCASE , so I thought I would lower it first. and then apply the style. I also tried removing the field case attribute, but it didn't work either.
When you insert it gives you a choice of none, lower or upper only.
Have any suggestions?
Hi Sharon
Maybe you'll need to create an XSLT macro to be able to return the text in lowercase then. In the Exslt extensions there is a lowercase() method, which you should be able to use. Once this is done you should be able to capitalize it.
Hope this helps.
/Jan
Sharon,
If you are interested in an XSLT extension to do this, try the following:
Cheers, Lee.
Thanks for the info. I am new to xslt umbraco and xslt extensions. With your help and all the other how to's on the forums. I got it working!
is working on a reply...