$ClassName output in Templates with Namespace in SS4.2.1?

Silverstripe Version: 4.2.1

Question: How do you stop the full namespaced class name appearing in your template if you’d used $ClassName in a class="$ClassName" situation to vary the CSS on a particular item based on data class?

I’m getting:
MyNameSpace\Website\ClassName instead of just ClassName as in SS3

Thanks

You can use $ClassName.ShortName and it should give you what you’re after :slight_smile:

2 Likes

Thank you, that’s great.