How to convert an Upper case string to lower case string in DWT, Tridion

511 Views Asked by At

How to convert an Upper case string to lower case string in DWT, Tridion?

I have a field in schema called ' title'. I got the value of title in DWT using "@@RenderComponentField(FieldPath+".title", 0)@@". I want to convert the returned value in to small letters.

3

There are 3 best solutions below

0
Jeremy Grand-Scrutton On

You can either use a .Net TBB to get the value and add it to the package in the format you require, or create a custom Function Source that contains a function that is callable from the template to create your desired output. I'd say that a Function Source is probably the better of the two options. You can find an example, and sample code, at http://sdltridionworld.com/community/extension_overview/dreamweaver_get_extension.aspx.

0
Frank van Puffelen On

It is possible to do this in DWT by using either a TBB or a custom function (as Jeremy has explained).

But you might also want to consider doing the same in the CSS of your site.

https://developer.mozilla.org/en-US/docs/CSS/text-transform

p { text-transform: lowercase; }

Which approach is best depends on the reason for wanting the text to become lowercase. Given that you are using a title field in your example, I expect that the reason is closely related to styling requirements - in which case I'd take the CSS route.

1
Arjen Stobbe On

Can you try the following expression? (I can't test it right now) It includes JScript, which should work.

@@"${RenderComponentField(FieldPath + ".title", 0)}".toLowerCase()@@