Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • firepol 125 posts 173 karma points
    Jun 11, 2013 @ 12:26
    firepol
    0

    MVC: different view for different template?

    Hi,

    I'm using umbraco 6.1.1 in MVC mode.

    My question: I'd like to have only 1 document type and the possibility to select different templates. If this is possible how/where/with which naming convention should I proceed with the views?

    Extended explanation:

    I have a document type called "Form". Under "Views" I have a razor view called "Form.cshtml".

    When I browse my page of node type "Form", the contents from Form.cshtml are taken correctly.

    When I created the document type "Form", a template called "Form" was added automatically. I think it's not needed.

    In fact I created another template called Form1, allowed Form to have as template "Form" and "Form1".

    I created a view called Form1.cshtml but this is never called.

    To use Form1.cshtml I'm afraid I need to create a new document type called "Form1".

    Can you tell me what I do wrong and help me?

    Thank you

  • firepol 125 posts 173 karma points
    Jun 11, 2013 @ 13:42
    firepol
    0

    I think I managed.

    I had to delete all files under "masterpages". For each template name I created a view with the same name under Views.

    So for example I created a template called "Form1", then had to delete masterpages\Form1.master and add Views\Form1.cshtml

Please Sign in or register to post replies

Write your reply to:

Draft