Try our conversational search powered by Generative AI!

Retrieving DisplayName programatically


Given I have the CurrentPage object, is it possible to get the value of the DisplayName programatically?
So in example below i should get "test". (CurrentPage.PageTypeName returns name, not the dsiplayname)

[ConSubmittentType(DisplayName ="test"

[Pasting files is not allowed]

Dec 08, 2014 9:10

Well I guess you are doing the right thing and keeping all your content type names in a lang file so you could get them with the Translate ;)

Else something like 

var repo = ServiceLocator.Current.GetInstance<ContentTypeRepository>());
            var pageType = repo.Load<currentpage.GetOriginalType()>();
            return pageType.DisplayName;
Dec 08, 2014 9:56
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.