Hi All,
I have created a lot of document types which are set under my Home template. Usually when I create content for my pages they are automatically put onto the templates but for some reason it is no longer the case. I am now trying to manually put in the code to do this but I am unsure how I get the document type Model name.
Here is an example of what I am trying to do:
This is the new document type I have made.
Then in the home template I am unsure how I can tell what would be the correct Model name, please can I have some help?
I would appreciate if someone could give me some help, thanks.
All other models work, the base of this was a starter template if that changes anything but I am pretty sure I have created groups which were automatically added to the templates but they have all stopped.
Anything new no longer put into the template and says it isn't in 'Home'.
I do not have access to Visual Studio with Umbraco as it is on a server I don't have access to.
Can you try to use the same statement which ist used withe the bodyText Argument? And instead use the alias of your new property. It hast to be the alias. If that works then I guess that ModelsBuilder doesn't update the Models. Which could be caused by how it is configured.
How to reference a document type in the template?
Hi All, I have created a lot of document types which are set under my Home template. Usually when I create content for my pages they are automatically put onto the templates but for some reason it is no longer the case. I am now trying to manually put in the code to do this but I am unsure how I get the document type Model name.
Here is an example of what I am trying to do:
This is the new document type I have made.
Then in the home template I am unsure how I can tell what would be the correct Model name, please can I have some help?
I would appreciate if someone could give me some help, thanks.
Still can't figure this out
Hi svumo,
In theory that ist exactly how you access properties in a view.
What exactly is the problem? Does that call not work? What error do you get?
This is what it says when trying to load the website:
At the top of your View, so you have a statement which starts with "@inherits"?
Normally you state which model the view ist working with, with that you should also have intelisense in Visual Studio.
All other models work, the base of this was a starter template if that changes anything but I am pretty sure I have created groups which were automatically added to the templates but they have all stopped.
Anything new no longer put into the template and says it isn't in 'Home'.
I do not have access to Visual Studio with Umbraco as it is on a server I don't have access to.
Can you try to use the same statement which ist used withe the bodyText Argument? And instead use the alias of your new property. It hast to be the alias. If that works then I guess that ModelsBuilder doesn't update the Models. Which could be caused by how it is configured.
how would i write the new statement with bodyText?
Try Model.Value("xyz") where xyz is the alias of your property
Please try
@Model.Content.ContentText
is working on a reply...