From the Getting started tours and Umbraco TV's intoductory episodes I've got the knowledge, that a content node needs a document type for defining the structure of its content, and a template for displaying the content in the browser. OK, that's fine, I understand it. But yesterday I've installed the Articulate package and I see that it has created some content nodes, each having some document type, but lacking a template. How do they work? It seems to me that a template is only one possibility to define the layout of a content. What are the other alternatives and where can I learn them from?
Think of the document type as a blue print / content container. Some webpages might not just need their own content but might use content from a number of child pages.
An example might be an About Us -> Our Staff page that lists staff members. You'd have a template called "Our Staff", with a corresponding content node that has the title and intro text etc. Underneath that content node you might have a number of StaffMember nodes. These are of doc type StaffMember but they don't need to have a Staff member template, instead their content is just looped through and output in the Our Staff page.
The above example is trivial and might now be better served with Nested Content but I hope it makes sense. In other words there's not really an alternative to templates (*) but in some cases some doc types don't need a template.
I guess you could not use templates at all and just use Umbraco as a content holder via API
Steve
Specifically, Articulate has created a tree with 3 content nodes , Blog, Archive and Authors. The latter 2 are the children of Blog. None of them have a template on its Info tab, however the Authors node doesn't show anything at all, except of an error message:
Can it be that they (or at least one of them) do have a template only the aren't displayed on the Info tab due to some error? Do you mean that some of them surely must have a template?
Now I've made a brand new Umbraco installation without the example web site. Then I've installed the Articulate package. Now I don't have any template in the whole system at all, still the website works! And there is no error message anywhere, everything's fine. How is it possible?
I think that this is an basic Umbreco question, not an Articulate specific one.
Remark: While there are no templates (I've checked this, and found the cmsTemplate table really empty!), there are "Articulate themes" in the "Settings" section. It seems to me that they are alternatives to templates, that's why I asked for them.
Yes - sorry - rereading your original post you do mention Articulate. Apologies for missing that! I've just spun a fresh installation up to have a look.
Understanding a bit about MVC will make this make more sense.
Modern Umbraco is based off of .NET MVC. MVC is an 'architectural pattern' used to split up a site's code based on the type of task the code is responsible for, to make it cleaner. It's not an Umbraco-specific thing, but Umbraco uses it. The M, V, and C stand for Model, View, and Controller, respectively, and all 3 are used for building a web page.
To give an [over]simplified summary, a controller should, ideally, run the code to access or generate the data used by the page, the model should take the data from the controller and wrap it up in a nice tidy package, and pass it to the View, which mixes it in with HTML and renders it. (Umbraco doesn't always follow this best practice, as it tends to encourage developers to put lots of code in the view, but that's a side-story.)
Umbraco's 'templates' are really just Views. A view is needed to render a page, so there's no alternative to them, they may just be in a different spot than normal, or may be called a View rather than a template.
Alternatives to a template
From the Getting started tours and Umbraco TV's intoductory episodes I've got the knowledge, that a content node needs a document type for defining the structure of its content, and a template for displaying the content in the browser. OK, that's fine, I understand it. But yesterday I've installed the Articulate package and I see that it has created some content nodes, each having some document type, but lacking a template. How do they work? It seems to me that a template is only one possibility to define the layout of a content. What are the other alternatives and where can I learn them from?
Think of the document type as a blue print / content container. Some webpages might not just need their own content but might use content from a number of child pages.
An example might be an About Us -> Our Staff page that lists staff members. You'd have a template called "Our Staff", with a corresponding content node that has the title and intro text etc. Underneath that content node you might have a number of StaffMember nodes. These are of doc type StaffMember but they don't need to have a Staff member template, instead their content is just looped through and output in the Our Staff page.
The above example is trivial and might now be better served with Nested Content but I hope it makes sense. In other words there's not really an alternative to templates (*) but in some cases some doc types don't need a template.
Specifically, Articulate has created a tree with 3 content nodes , Blog, Archive and Authors. The latter 2 are the children of Blog. None of them have a template on its Info tab, however the Authors node doesn't show anything at all, except of an error message:
Can it be that they (or at least one of them) do have a template only the aren't displayed on the Info tab due to some error? Do you mean that some of them surely must have a template?
Probably best to post this error to the Articulate forum - I'm not au fait with it I'm afraid.
Now I've made a brand new Umbraco installation without the example web site. Then I've installed the Articulate package. Now I don't have any template in the whole system at all, still the website works! And there is no error message anywhere, everything's fine. How is it possible?
I think that this is an basic Umbreco question, not an Articulate specific one.
Remark: While there are no templates (I've checked this, and found the cmsTemplate table really empty!), there are "Articulate themes" in the "Settings" section. It seems to me that they are alternatives to templates, that's why I asked for them.
Yes - sorry - rereading your original post you do mention Articulate. Apologies for missing that! I've just spun a fresh installation up to have a look.
Have you seen the documentation? https://github.com/Shazwazza/Articulate/wiki
The views are all stored in the themes folder under /App_Plugins/Articulate/Themes/Shazwazza/Views
Custom Controllers are used which render the view in code. Here's a key example: https://github.com/Shazwazza/Articulate/blob/master/src/Articulate/Controllers/ArticulateController.cs
HTH
Steve
Thanks, Steve! Am I right, that one alternative of the templates are Custom Controllers? Or does this solution hack Umbraco?
It's not a hack I suspect it's just using this: https://our.umbraco.org/documentation/reference/routing/custom-controllers
Understanding a bit about MVC will make this make more sense. Modern Umbraco is based off of .NET MVC. MVC is an 'architectural pattern' used to split up a site's code based on the type of task the code is responsible for, to make it cleaner. It's not an Umbraco-specific thing, but Umbraco uses it. The M, V, and C stand for Model, View, and Controller, respectively, and all 3 are used for building a web page.
To give an [over]simplified summary, a controller should, ideally, run the code to access or generate the data used by the page, the model should take the data from the controller and wrap it up in a nice tidy package, and pass it to the View, which mixes it in with HTML and renders it. (Umbraco doesn't always follow this best practice, as it tends to encourage developers to put lots of code in the view, but that's a side-story.)
Umbraco's 'templates' are really just Views. A view is needed to render a page, so there's no alternative to them, they may just be in a different spot than normal, or may be called a View rather than a template.
Hope that helps clarify things.
Regards,
David
is working on a reply...