1

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.

genpfault
  • 51,148
  • 11
  • 85
  • 139
user1740212
  • 139
  • 1

3 Answers3

2

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.

Jeremy Grand-Scrutton
  • 2,802
  • 14
  • 20
2

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.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
1

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

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

Arjen Stobbe
  • 1,684
  • 9
  • 15