Hot to get Localized block description from within a block view.

Vote:
 

I might be stupid but I can't figure out how I can get the LocalizedDescription for a block inside a view.

I'm using forms.

Probably easy but I need help.

#70021
Apr 11, 2013 8:59
Vote:
 

I solved by adding a method to the views generic baseclass. But there must be a better way.

 

public string Desc()
{
var repository = ServiceLocator.Current.GetInstance<IContentTypeRepository>();
var blockrepository = new BlockTypeRepository(repository);
string slask = blockrepository.Load<T>().LocalizedDescription;
return slask;
}

#70043
Apr 11, 2013 10:43
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.