Copied to clipboard

Flag this post as spam?

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


  • Jose 2 posts 22 karma points
    Feb 10, 2015 @ 16:41
    Jose
    0

    MVC Razor Views in backend

    Hello,

    I am trying to move from Umbraco 6 version to Umbraco 7 (7.2.1) with big backend made in Razor. I have been looking about information how to put this running in Umbraco 7 but i only can use AngularJS inside App_Plugins folder and I can't use my Views in Razor there. Do I have to rebuild everything? or there is a way to use my current views with Umbraco 7 (only talking about backend)

    Another issue is about the Tree, in the old version I had an Application and a Tree where each node go to a different Controller, now i have seen the Tree is working only with one Controller :( 

    [PluginController("xxx"))

    Is there a way to say for example:
    When i create the Tree now i have these, it mades to me more or less what i want but using AngularJS:
    var route = string.Format("/BackEnd/BackEndTree/{0}/{0}", controllerName);
    Thanks very much!!
  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Feb 10, 2015 @ 16:56
    Jan Skovgaard
    0

    Hi Jose and welcome to our :)

    You should be able to attach a controller for each tree if I'm not mistaken. Perhaps Tim Geyssens blogpost here http://www.nibble.be/?p=440 can help?

    When you say big backend...what do you mean then? Is it a custom section with many trees? Then perhaps having a look in the source code for packages like Merchello and Google Analytics for Umbraco could be of use so you can see how they do things maybe?

    Hope this helps a bit.

    /Jan

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Feb 10, 2015 @ 16:57
    Jan Skovgaard
    0

    ..Also make sure to visit the documentation about sections and trees here https://our.umbraco.org/documentation/Extending-Umbraco/Section-Trees/

    /Jan

  • Jose 2 posts 22 karma points
    Feb 10, 2015 @ 17:00
    Jose
    0

    Thanks a lot about the documentation Jan... I will take a look about Section Trees

    My big problem is about AngularJS and Razor backend views because we have a backend with almost 400 different Views and if we have to rebuild all the views without Razor I can buy a gun I think :)

  • user33 9 posts 56 karma points
    Feb 17, 2015 @ 15:57
    user33
    0

    You can use the views with Razor code as partial views and call it from surface controllers. No need to rebuild the entire code.

    controller

    ==========

     public class SampleController : SurfaceController

        {

           public ActionResult Index()

            {

                return PartialView("sampleView", new SampleModel());

        }

    }

    View

    ==============

    @using sample.Controllers

    @model sample.Models.sampleModel

                     

               @using (Html.BeginUmbracoForm<sample.Controllers.sampleController>)

               {         

    <!-- Razor code-->
    }

     

  • mmaty 113 posts 286 karma points
    Apr 27, 2016 @ 08:25
    mmaty
    0

    @Jose: I have a similar situation. I don't think, the answers up to this Point were very helpful.

    Did you find a solution?

    -- Mirko

  • Marcio Goularte 388 posts 1360 karma points
    Oct 23, 2017 @ 22:06
  • Jonathan Roberts 409 posts 1063 karma points
    Aug 30, 2019 @ 11:21
    Jonathan Roberts
    0

    Is there a nicer way to do this in Umbraco 8?

Please Sign in or register to post replies

Write your reply to:

Draft