Copied to clipboard

Flag this post as spam?

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


  • Dan 65 posts 209 karma points
    Jun 05, 2014 @ 12:33
    Dan
    0

    alternative to document.Published

    the alternative to document.Published ?

    When I use the document.Published it says it's obsolute and I should use Umbraco.Core.Models.Content but when I make a content node Like this

    Umbraco.Core.Models.Content node = new Umbraco.Core.Models.Content(Name, ParentId, contentType);
    

    I can't get the node values like this then it will say the value is empty.

    item.GetValue("property-Name").ToString()
    
  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jun 05, 2014 @ 12:58
    Dirk De Grave
    100

    Dan,

    Me thinks you need to save your node first before getting any value from any property. Saving of your node has to be done via content service. More info on the new api (and more specifically services) can be found here

     

    Cheers,

    DIrk

  • Dan 65 posts 209 karma points
    Jun 05, 2014 @ 13:03
    Dan
    0

    I got data in the database, and I can get the node value like this on the document

     document.getProperty("property-Name").Value.ToString()
    

    Im guessing it's because it's a new object not related to the one in the database ?

  • Dan 65 posts 209 karma points
    Jun 05, 2014 @ 13:07
    Dan
    0

    this must work ? contentService.GetById()

  • Dan 65 posts 209 karma points
    Jun 05, 2014 @ 13:13
    Dan
    0

    Think I got it now

    I got confused by how you get a node

      Node newNode = new Node(1234);
    

    then I thought you should do the same with Umbraco.Core.Models.Content

Please Sign in or register to post replies

Write your reply to:

Draft