Copied to clipboard

Flag this post as spam?

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


  • Brakkar 12 posts 53 karma points
    Jun 14, 2015 @ 09:46
    Brakkar
    0

    Extracting custom content and displaying it into a page

    Hi, sorry if the question is newbie... i will dig into the tv videos this week but couldn't wait and explore some youtube videos.

    On this video: https://youtu.be/0PtzyrEFG7I the author creates a custom content type table for "comments". Then, to insert them into his page, he goes through the MVC way: he creates a controller, view....

    Yet from what I read, he could have easily displayed his comments with a razor syntax to fetch content and display them directly into a template. This seems that it is what is teached on the tv videos

    What are the Umbraco philosophy and when use one approach over the other ? Also how can I see a list of blog post extracted with razor on the starter site demo package.... even if there is NO mvc structure to support the blog content type (no model, or controller). I just don't get it.

    Thanks, Benj

  • Ifrahim Rasool 28 posts 84 karma points
    Jun 15, 2015 @ 15:56
    Ifrahim Rasool
    0

    @Umbraco.Field("Comments") This is display Node property value for CurrentPage,

  • Carl Jackson 139 posts 478 karma points
    Jun 15, 2015 @ 16:19
    Carl Jackson
    100

    Hi Benj.

    I think it depends a lot on experience level and what you want to achieve. You can go a long long way in Umbraco without adding in any Render or Surface controllers, and if you are building a simple site, maybe just for yourself this can be a good option.

    However the scalability of Umbraco allows for you to use a Rendor or Surface controllers to do your code in the correct place (not in the views) and create strongly typed models if you so wish.

    As a developer I use a mix of both allowing Umbraco to handle the controller and dynamic model setup and taking over myself.

    There is a cut off point for me that if you need to do more than loop through all children of the current page then you should be adding in a controller and doing the code in their.

    Umbraco is very flexible just like .net MVC you have to use your own common sense a little and stick to a set of principles about where code should be done.

    Just my view but hope this helps.

  • Brakkar 12 posts 53 karma points
    Jun 15, 2015 @ 19:47
    Brakkar
    1

    Thanks this clarifies. I see there is no "wrong" way to fetch data and that both can coexist.

Please Sign in or register to post replies

Write your reply to:

Draft