Hello, I have a running Umbraco instance and am trying to create a new site in the same instance. The new site is nearly the same but for a different country and requires some different css and content.
Since it requires different styles I presumed it would make sense to have a new MainLayout tree parallel to the original which will be first an exact copy of the original and then I can apply the changes only to the new tree of templates. After updating the Data Type for the relevant pages to have the new template as an allowed template, I can apply those templates to the parallel tree of content I've created.
However I have run into some exception when I try to do this, even while the templates are still identical. Anytime I duplicate a template and configure a duplicate content object to use it I will see a 500 error when browsing to that content and find the exception linked below in the UmbracoTraceLog.txt
I must be misunderstanding something about how the templates work.
One thing I've noticed about the templates that were built for this site (by someone else) is that they at least mostly don't seem to use the @inherits structure I always see in the examples and blocks automatically generated when creating a sub-template. Instead they have a @model defined and an @using, so I suspect I need to understand more about that structure.
I believe I have found what is causing the issue I described above.
It seems that some of the models created for this site are specifying exactly which template it can be used with.
I am finding that each of my pages has a **ViewModel.cs to interact with Umbraco's DataTypes and make them available for use in the template. In this file I am finding this (I believe it is called a) decorator:
[UmbracoEntity("Home", TemplateName = "Home")]
or
[UmbracoEntity("FaqDetail")]
I've seen the API doc for UmbracoEntity but I could use a little more high-level explanation of how it is used here.
It appears to be specifying the Document Type with the first (and unnamed) argument and then it may specify a template. Is there anything else here I should be aware of?
Specifically, how could I change it so that this ViewModel with a Home Document Type could use either one theme or another? Can I pass it a list of theme names? or does not specifying the template name here leave it wide open for use by any template that uses that @model?
Parallel Site. Data Types and Templates
Hello, I have a running Umbraco instance and am trying to create a new site in the same instance. The new site is nearly the same but for a different country and requires some different css and content.
Since it requires different styles I presumed it would make sense to have a new MainLayout tree parallel to the original which will be first an exact copy of the original and then I can apply the changes only to the new tree of templates. After updating the Data Type for the relevant pages to have the new template as an allowed template, I can apply those templates to the parallel tree of content I've created.
However I have run into some exception when I try to do this, even while the templates are still identical. Anytime I duplicate a template and configure a duplicate content object to use it I will see a 500 error when browsing to that content and find the exception linked below in the
UmbracoTraceLog.txt
http://clipboard.space/clip/v31n92xWLBuOEGWW3069
I must be misunderstanding something about how the templates work.
One thing I've noticed about the templates that were built for this site (by someone else) is that they at least mostly don't seem to use the @inherits structure I always see in the examples and blocks automatically generated when creating a sub-template. Instead they have a @model defined and an @using, so I suspect I need to understand more about that structure.
e.g.
I believe I have found what is causing the issue I described above.
It seems that some of the models created for this site are specifying exactly which template it can be used with.
I am finding that each of my pages has a **ViewModel.cs to interact with Umbraco's DataTypes and make them available for use in the template. In this file I am finding this (I believe it is called a) decorator:
or
I've seen the API doc for UmbracoEntity but I could use a little more high-level explanation of how it is used here.
It appears to be specifying the Document Type with the first (and unnamed) argument and then it may specify a template. Is there anything else here I should be aware of?
Specifically, how could I change it so that this ViewModel with a Home Document Type could use either one theme or another? Can I pass it a list of theme names? or does not specifying the template name here leave it wide open for use by any template that uses that @model?
I've realized the site's (3rd party) orm library is actually open source and can be found here:
https://github.com/thenerdery/UmbracoVault
is working on a reply...