Copied to clipboard

Flag this post as spam?

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


  • skiltz 501 posts 701 karma points
    Oct 10, 2009 @ 09:43
    skiltz
    0

    .net Publishing Nodes

    When we create a new document in a user control (document.makenew()) what is the best way to publish a node so it's avaliable on the front end straight away with out causing slow downs for other users?

    We have a job posting board which potentially could have new jobs posted ever 5 minutes. If the the whole site xml needs to recached what is the impact of this going to be?

    Also what is the prescribed way to "save" and "publish like below?

    d.Save();
    d.Publish(
    new umbraco.BusinessLogic.User(0));
    umbraco.
    library.UpdateDocumentCache(d.Id);

  • Nik Wahlberg 639 posts 1237 karma points MVP
    Oct 10, 2009 @ 15:19
    Nik Wahlberg
    1

    Hi Skiltz,

    If you are trying to publish individual items, you should take a look at the following:

              umbraco.library.PublishSingleNode(doc.Id);

    So, the process would be something like this:

              Document doc = Document.MakeNew(
                    Title.Text,
                    DocumentType.GetByAlias("DocType"),
                    adminUser,
                    ParentId);
               // set document properties...
               doc.getProperty("someProp").Value = "the Value";

                // now publish the content
                doc.Publish(adminUser);

               
                // publish the ticet on the site
                umbraco.library.PublishSingleNode(doc.Id);

    Hope this helps as this should not force an update of the document cache everytime you post a new job.

    Thanks,
    Nik

  • skiltz 501 posts 701 karma points
    Oct 14, 2009 @ 10:43
    skiltz
    0

    Nik

    This is 90% working however I have a situation where 1 property in the document that isn't getting published.  The page is active on the front end and a custom datatype(checkboxlist) is fine but a property of type rte isn't getting publish.  I'm forced to manually go into the gui and press publish and then works fine. The text is getting saved just not published.  ANy idea's?

     

     

  • skiltz 501 posts 701 karma points
    Oct 14, 2009 @ 10:59
    skiltz
    0

    And if I open umbraco.config its in there.

  • Nik Wahlberg 639 posts 1237 karma points MVP
    Oct 15, 2009 @ 03:34
    Nik Wahlberg
    0

    That is interesting. I know there have been some issues using the RTE as custom control in user controls, but as far as the publishing goes I have not seen this.

    @Dirk, didn't you have something on this?

    Cheers,
    Nik

  • Nik Wahlberg 639 posts 1237 karma points MVP
    Oct 15, 2009 @ 03:36
    Nik Wahlberg
    0

    I have posted a Tweet for Dri k to chime in here. Thx.

  • skiltz 501 posts 701 karma points
    Oct 15, 2009 @ 06:40
    skiltz
    0

    I'm not actually using RTE in the front end yet.  This was just a normal asp:textbox but saving to a property of type rte.

  • Mikael Mørup 297 posts 326 karma points
    Oct 15, 2009 @ 12:57
    Mikael Mørup
    0

    You need to update the XML cache afte you publish:

    umbraco.library.UpdateDocumentCache(doc.Id)

  • Mikael Mørup 297 posts 326 karma points
    Oct 15, 2009 @ 13:03
    Mikael Mørup
    0

    Ups i didn't see the post that you already checked that is is in the umbraco.config, so my previous post is probably not correct.

    Anyway, i thought you had to call UpdateDocumentCache before it would be "properly published"??

  • skiltz 501 posts 701 karma points
    Oct 18, 2009 @ 01:48
    skiltz
    1

    When I changed the control to the RTE it actually published correctly.  Thanks for the comments/suggestions.

Please Sign in or register to post replies

Write your reply to:

Draft