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.
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.
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
@Umbraco.Field("Comments") This is display Node property value for CurrentPage,
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.
Thanks this clarifies. I see there is no "wrong" way to fetch data and that both can coexist.
is working on a reply...