I want to get all the properties from a document type VIA razor script, to be exact, I want to get all the properties from a specific tab in the document type.
If you just need to get the values from the page you're currently on you should be able to simply write @Model.YourPropertyName for each of the properties you need to fetch the values from.
I understand what you're trying to do, however I can't work out why you would need to do it, maybe like you say there is another way to think about it?
Getting properties from document type
I want to get all the properties from a document type VIA razor script, to be exact, I want to get all the properties from a specific tab in the document type.
is there any way that I can do it?
Hi Moran
If you just need to get the values from the page you're currently on you should be able to simply write @Model.YourPropertyName for each of the properties you need to fetch the values from.
You can read more about the Razor syntax here http://our.umbraco.org/documentation/reference/Templating/Macros/Razor/
/Jan
Yes, I am fimiliar with that.
but is there a way to get to a specific tab in my properties and iterate througth them with a loop of some sort? instead of getting to each one?
Hi Moran,
What you could do is run a test to match all nodes using the same docType first.
or
Ok
so this will get me all the nodes by doc type, and how cann I get all the properties from that node? without writing them down all of them.
Hi Moran,
In any case you will need to make use of the propertyAlias to call the infos. In the example above
Thanks
I think I need to change the way I think about it, giving the users too many fields to fill for every page isn't a good practice.
Hey Moran,
I understand what you're trying to do, however I can't work out why you would need to do it, maybe like you say there is another way to think about it?
Let us know.
Rich
is working on a reply...