Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Lars Ljungqvist 14 posts 34 karma points
    Feb 18, 2013 @ 14:39
    Lars Ljungqvist
    0

    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>
      
    }

  • Andreas Iseli 150 posts 427 karma points
    Feb 18, 2013 @ 15:42
    Andreas Iseli
    0

    Hello Lars

    You must first publish the document(s) again, else the properties won't be available.

    Andreas

  • Sarah 40 posts 104 karma points
    Feb 18, 2013 @ 18:06
    Sarah
    0

    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.

  • Lars Ljungqvist 14 posts 34 karma points
    Feb 19, 2013 @ 13:52
    Lars Ljungqvist
    0

    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?

  • Sarah 40 posts 104 karma points
    Feb 19, 2013 @ 15:47
    Sarah
    0

    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. 

  • Lars Ljungqvist 14 posts 34 karma points
    Feb 20, 2013 @ 10:07
    Lars Ljungqvist
    0

    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?

  • Sarah 40 posts 104 karma points
    Feb 20, 2013 @ 17:33
    Sarah
    0

    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! 

Please Sign in or register to post replies

Write your reply to:

Draft