Hi. I have a funny problem. I extenced a Document type called "Medarbejder" (Employee) with some new properties.
I am reading content from this Document type in razor and it works fine but I can't get the NEW properties that I put in the Document type. In the code below that means that the "@node.OrderNr.ToString()""@node.formueBase" are not rendered.
Any help will be highly appreciated
// Lars
This is the simple code. A screendump of the document type is inserted below
@inherits umbraco.MacroEngines.DynamicNodeContext @{ // Get root node: var root = Model.AncestorOrSelf();
// Get all descendants, filter by type: var nodes = root.Descendants("Medarbejder"); // Loop through the filtered nodes, displaying the properties: <head> <meta name="robots" content="noindex"> </head> <ul> @foreach (var node in nodes) { <li> <h2>@node.Navn</h2> <p>@node.Stilling og2 @node.ErSpecialist.ToString()<br /> AND3 @node.OrderNr.ToString() AND4 @node.formueBase AND5 @node.Emaill</p> </li> } </ul> }
Hi Andreas. Thank you for your answer. That sounds very reasonable but unfortunately it didn't help me. I am LOST. Strange enough I earlier added a field to my document type. Razor accepted it without any kind of troubles! Did you find a solution, Sarah?
I installed Rodion's package which if you right click content to republish entire site, gives you some extra options. I used the one to rebuild database cache and it worked perfectly for me. This issue must have been something specific to my local environment as I didn't have the same problem on my test or live environment.
Hi Sarah. Thank you for your answer and advice. I have installed the Rodion package and republished the entire site inlcuding a rebuild of the database cache. Still no reaction. My Umbraco version is 4.7.1. Do you know any other solution that could be tried out?
I don't sorry Lars. Did you check the dbo.cmsContentXml table for the node you are having problems with to see if your new properties are appearing in the XML for the node in there? It is a very frustrating problem!
Razor will only render old parts of Document type
Hi. I have a funny problem. I extenced a Document type called "Medarbejder" (Employee) with some new properties.
I am reading content from this Document type in razor and it works fine but I can't get the NEW properties that I put in the Document type. In the code below that means that the "@node.OrderNr.ToString()" "@node.formueBase" are not rendered.
Any help will be highly appreciated
// Lars
This is the simple code. A screendump of the document type is inserted below
@inherits umbraco.MacroEngines.DynamicNodeContext
@{
// Get root node:
var root = Model.AncestorOrSelf();
// Get all descendants, filter by type:
var nodes = root.Descendants("Medarbejder");
// Loop through the filtered nodes, displaying the properties:
<head>
<meta name="robots" content="noindex">
</head>
<ul>
@foreach (var node in nodes)
{
<li>
<h2>@node.Navn</h2>
<p>@node.Stilling og2 @node.ErSpecialist.ToString()<br />
AND3 @node.OrderNr.ToString() AND4 @node.formueBase AND5 @node.Emaill</p>
</li>
}
</ul>
}
Hello Lars
You must first publish the document(s) again, else the properties won't be available.
Andreas
I'm having the same problem as this and have posted about it. I have published the document again (many times!) but I'm still not seeing the property.
Hi Andreas. Thank you for your answer. That sounds very reasonable but unfortunately it didn't help me. I am LOST. Strange enough I earlier added a field to my document type. Razor accepted it without any kind of troubles! Did you find a solution, Sarah?
I did! Thanks to the help of a forum member. It seems my new property hadn't properly propagated down. See my answered post here http://our.umbraco.org/forum/developers/razor/38511-New-property-on-DocType-not-appearing-in-Razor-code
I installed Rodion's package which if you right click content to republish entire site, gives you some extra options. I used the one to rebuild database cache and it worked perfectly for me. This issue must have been something specific to my local environment as I didn't have the same problem on my test or live environment.
Hi Sarah. Thank you for your answer and advice. I have installed the Rodion package and republished the entire site inlcuding a rebuild of the database cache. Still no reaction. My Umbraco version is 4.7.1. Do you know any other solution that could be tried out?
I don't sorry Lars. Did you check the dbo.cmsContentXml table for the node you are having problems with to see if your new properties are appearing in the XML for the node in there? It is a very frustrating problem!
is working on a reply...