Defining the Topic View (.NET)

If MVC data is required for rendering content from Tridion Docs, you can let the Strongly Typed Topic Model define the View to be used.

Unlike with Tridion Sites, Tridion Docs cannot define the View to be used for rendering the Strongly Typed Topic Model. This may not be a problem, but if you need MVC data to render the content, you can override the GetDefaultView method and allow the Strongly Typed Topic Model to define the View.

Example

[SemanticEntity(Vocab = DitaVocabulary, EntityName = "learningBasebody")]
public class LearningBaseTopic : EntityModel
{
    [SemanticProperty("title")]
    public string Title {get; set;}
 
    [SemanticProperty("lcIntro")]
    public RichText Intro {get; set;}
 
    [SemanticProperty("lcObjectives")]
    public RichText Objectives {get; set;}
 
    public override MvcData GetDefaultView(ILocalization localization)
    {
        return new MvcData("Test:Topic:LearningBaseTopicView");
    }
};