Copied to clipboard

Flag this post as spam?

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


  • Joe Noble 5 posts 26 karma points
    Sep 16, 2010 @ 04:52
    Joe Noble
    0

    Modified Document: Not Showing non published Status in Tree

    Let me start by saying I am an Umbraco noob.  :)  Now that it's out of the way...I have created a "members" section of the website that will allow members to update content in what would be considered a "microsite." The updating happens by way of asp.net usercontrol that taps into the api in the code behind. So far everything seems to be straightforward until I realized that I am going to need my custom section and the Umbraco backend to play nice with one another.

    I have followed all tutorials and documentation and they all end with something like:

    doc.Publish(author);
    umbraco.library.UpdateDocumentCache(doc.Id);

    This is fine if you want top publish directly to the site, but I need the api to save the values and mark it accordingly in Umbraco. By marking I mean placing the attribute on the node/document that tells the tree that it still needs to be published (little starburst on the folder!). I guess that is one portion of Umbraco that I have yet to understand, so if someone feels like telling me how it works I would be ever grateful! It would be nice if I could tie it into the notifications portion too, but is not essential.

    I know this seems like an over-complicated process to do what is already coded in Umbraco itself, but I have no control as to how the client wants it! Please help... I don't have much hair left on my head from pulling it!

    
    
                    
  • Ernst Utvik 123 posts 235 karma points
    Sep 16, 2010 @ 15:27
    Ernst Utvik
    0

    If I understand you correctly you want the user to make a new document, but not publish it?
    In that case removing the two lines of code that you have entered above should create the wanted result.

    The document gets created with the line:

    Document doc = Document.MakeNew(nodename, documenttype, author, parentid);

  • Joe Noble 5 posts 26 karma points
    Sep 16, 2010 @ 15:45
    Joe Noble
    0

    Not to make a new page, but to edit an existing page. Basically I am pulling the document id from a querystring value:

    Document doc = new Document(Convert.ToInt32(Request.QueryString["id"].ToString()));

    Then I am going through the process of saving TextBox data to the properties via alias:

    doc.getProperty("cms_pageTitle").Value = title.Text;

    This is tied to a button click event. The data saves properly to the database. When I log in as administrator I can see the changes in that page just fine, and of course it has not published to the actual site (which is what I want). The problem is that the node icon for that page does not reflect that there are unpublished changes. and the following bool does not evaluate properly:

    doc.HasPendingChanges()

    For this project to work, I need the HasPendingChanges() to evaluate "True" and the content node tree icon to reflect that as well. I am hoping that I did not miss something easy (or it can be done!).

  • Joe Noble 5 posts 26 karma points
    Sep 16, 2010 @ 16:26
    Joe Noble
    1

    Scratch my request for help... I just showed that I really am a noob! :-P

     

    For anyone who has run into this simple problem...All I had to do was set the following value and save:

    doc.Published = false;
    doc.Save();

    Thanks for your help!

  • Ernst Utvik 123 posts 235 karma points
    Sep 16, 2010 @ 20:21
    Ernst Utvik
    0

    Great job :) That was new to me as well. Good to know!

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Sep 16, 2010 @ 20:36
    Dirk De Grave
    0

    Hi Joe,

    Don't worry, we've all been in that stage... but given you a h5yr for providing the feedback on your own question. Keep up with that, much appreciated!

     

    Cheers,

    /Dirk

Please Sign in or register to post replies

Write your reply to:

Draft