Copied to clipboard

Flag this post as spam?

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


  • Brian Hvarregaard 21 posts 61 karma points
    Jun 08, 2018 @ 17:27
    Brian Hvarregaard
    0

    What is the best way to show custom objects on multiple pages?

    Hi, I am building a large portal for one of my customers and is right now expanding the functionality with a ton of custom objects. I am building what resembles a normal CRM with a protected member frontend (a member can login on a custom frontend to see the customers).

    Right now i find myself creating one document type (empty) and multiple templates (one for each CRM page).

    • Show customers
    • Create customer
    • Update customer
    • Delete customer
    • Create contact on customer
    • Manage all contacts on customer
    • etc... (all the CRUD pages)

    It got me thinking if there is a better way to manage all these pages. I mean its not very lean and nice code to have all these templates. Also it means that in my backend im building the layout of my CRM with "empty" pages and just selecting the template for each page.

    Is this just the way to build these "big" integration projecs with custom objects, or is there more to it?

    What would be the better approach to do this. I a normal MVC project I would have a controller and view models. Right now I seem to be getting my data from my Razor.

  • Dan Diplo 1554 posts 6205 karma points MVP 5x c-trib
    Jun 08, 2018 @ 20:02
    Dan Diplo
    100

    You can still use controllers in Umbraco, if you wish, to handle logic:

    https://our.umbraco.org/documentation/Implementation/Controllers/

    Generally you'd use Render controllers if you want to customise a view model in the controller. And use Surface controllers if you are using forms to post data to a controller.

  • Brian Hvarregaard 21 posts 61 karma points
    Jun 08, 2018 @ 20:08
    Brian Hvarregaard
    0

    So I would still go for one document type. One template per page (and then build a 20 page structure in umbraco backend with different templates). Then connect each page to a custom controller with a viewmodel?

Please Sign in or register to post replies

Write your reply to:

Draft