Copied to clipboard

Flag this post as spam?

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


  • Edward 3 posts 23 karma points
    May 21, 2014 @ 17:02
    Edward
    0

    Blank templates - MVC setup problem, or possible behaviour?

    Hi all,

    I've inherited an Umbraco 6.0.5 site from another developer, and I'm trying to clarify if there's a problem with the MVC setup on their server (as seen in http://our.umbraco.org/forum/core/general/43838-Templates-blank-in-backend-after-upgrading-to-613) or if what I'm seeing is actually correct.

    As far as I can see, the site has been designed with MVC Views - so if I look at the Views directory on the server, I've got 15 cshtml files (plus a bunch of Partial Views in a sub folder as expected).

    ... but, when I look through the Umbraco Settings panel, I see a list of all of these MVC templates under Settings ->Templates (so all of their aliases match up to the cshtml filenames), but all of them are blank in Umbraco's editor ... whereas if I look at any of the partial views in Settings -> Partial Views the code shows up as expected. 

    All the document types map to the template aliases correctly, all of the content is working and the users can continue creating as normal ... but those blank templates don't seem correct. I can see the expected code in them if I open through the file system.

    Is there a way to hide templates like this? Or is it likely to be an MVC setup problem?

    Thanks a lot,

    Edward.

     

  • Charles Afford 1163 posts 1709 karma points
    May 26, 2014 @ 20:55
    Charles Afford
    0

    Hi, Sorry for the late reply.

    The problem is you do not have any 'views'

    A view is made up of many 'partial views'

    Do you have any in the application root under templates folder?

     

    Charlie :)

  • Edward 3 posts 23 karma points
    May 27, 2014 @ 22:30
    Edward
    0

    Hi Charlie,

    Thanks for the reply!

    I'm seeing both Views and Partial Views when looking at the file system directly through Windows - in the Umbraco Settings panel, I see the list of Views in the Templates section that are in the Views folder on the server, but all of them are blank (rather than showing the View's cshtml that exists if I open each one of them directly into Visual Studio through Windows on the server), whereas the Partial Views cshtml is appearing in the Settings panel without a problem.

    From what I've read on the link below, pure MVC Views need a change to the server to become editable through the Templates area in Umbraco:

    http://www.netaddicts.be/umbraco/hack-templates-tree-to-show-all-mvc-views/

    So I guess I'm stuck either editing the MVCs directly, or getting the above to be implemented.

    Unless you have any other ideas!

    Thanks again.

    Edward.

  • Charles Afford 1163 posts 1709 karma points
    May 27, 2014 @ 22:45
    Charles Afford
    0

    Hi Edward,

    Sorry very confused about what you are actually trying to do?

    I am concerned you are trying to edit code in the umbraco backoffice.

    Could you tell me in a nutshell what you are trying to do and i will help you :).

    Charlie :)

     

  • Edward 3 posts 23 karma points
    May 28, 2014 @ 16:37
    Edward
    0

    Hi Charlie,

    Thanks for another response.

    In a nutshell - I just want to edit templates through Umbraco -> Settings -> Templates as normal. It's simply that.

    It seems can't do this because (suggested in the link above) when MVC views have been used instead of building templates via Umbraco's back office, they don't render in the Settings -> Templates area (showing as blank). This leaves me having to edit them in Visual Studio, which is fine - but if I want to allow users of the site to edit these themselves in the back office (without giving them some form of remote access to the server other than Umbraco's CMS) this type of setup means I can't let them do it.

    What I was really trying to establish was whether the MVC view thing is actually 100% true, or whether what has infact happened is more like this upgrade issue:

    http://our.umbraco.org/forum/core/general/43838-Templates-blank-in-backend-after-upgrading-to-613

    Thanks again!

    Edward.

  • Charles Afford 1163 posts 1709 karma points
    May 28, 2014 @ 20:46
    Charles Afford
    0

    No you can edit the templates, which are now views.  Have you changed the umbraco mode to MVC instead of web forms.

    If you create a new Template(View) in the umbraco backoffice you will see that you can edit it and the changes will be reflected when you open that same file in Visual Studio,

    It does sound like an upgrade issue and its something you can do.

    I would really be concerned about giving content editors and alike access to modify the code espcially when it is outside of a development enviroment.

    Charlie :)

Please Sign in or register to post replies

Write your reply to:

Draft