I think you're misunderstanding how the transformations work. For a given page type you can have multiple transformations. Let's say you have a page type called Article (code name cms.article
). In this page type you have a transformation with the code name of detail
By default in your repeater web part when you select the detail
transformation for the cms.article
page type, it will display that in the site's default culture which we'll say is en-JM
. That transformation has whatever code you want in it. It could have a totally different layout, it could be displaying totally different fields, and it could be formatting the data totally different from any other transformation. The key is that is used for the default culture of the site AND any other cultures that are not yet defined like below.
In the transformation listing for the cms.article
page type, clone the default
transformation and set the code name to default_fr-fr
. Modify your transformation to have whatever code, layout, fields, etc. you want for the French culture. In the repeater, you do nothing, just leave the initial transformation (cms.article.detail
) selected and the system will do the rest. When someone navigates to your site and selects the French culture, it will automatically pick that up and use the French transformation.
Now on to your specific issue, I'm unsure of what the Spec
field's datatype is or what it's expecting for data format but let's assume it's a string that is always 12 characters long and has a value of something like xxxxxxyyyyyy
. In your detail
transformation, which would be for the en-JM
culture, on the cms.article
page type, do something like the following
<%# Eval("Spec") %> // displays the full value of the field
<%# Eval<string>("Spec").Substring(0,6) %> // displays the first 6 characters
Now in your detail_fr-fr
transformation on the cms.article
page type, do something like the following:
<%# Eval<string>("Spec").Substring(6,6) %> // displays the last 6 characters
You can use regular C#, in most cases, directly in your ASCX transformation.
I'd highly recommend going through the Kentico 12 Developer Training as these are some of the fundamentals Kentico was built. And you won't get very far if you don't understand the fundamentals.