Copied to clipboard

Flag this post as spam?

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


  • Simon Kibsgård 62 posts 73 karma points
    Feb 12, 2011 @ 11:51
    Simon Kibsgård
    0

    Removing tags from node via API

    Hi

    I have created a Tag editor, that can edit and delete tags from the database (both the tag and the node relation). Now, the tag will stay in plain text on the node, that it was once published to and I can first get it removed or renamed once I republish the node in the cms ui.

    When I try to republish the nodes via API after deleting the tags and relation in the database I experience it to be both very slow and also not to update the tags.

     

    foreach (int nodeId in nodeIds)
    {
        Document doc = new Document(nodeId);
        doc.Publish(u);
      umbraco.library.UpdateDocumentCache(nodeId);
    }

    I figure I am doing something wrong or forgetting something?

    /Simon K

     

  • Simon Kibsgård 62 posts 73 karma points
    Feb 12, 2011 @ 11:54
    Simon Kibsgård
    0

    (where nodeIds is a list ids of the nodes priorly tagged with the now changed or deleted Tag)

    Anyone?

  • Simon Kibsgård 62 posts 73 karma points
    Feb 14, 2011 @ 20:32
    Simon Kibsgård
    0

    I wonder if anyone can answer my question or at least give me a hint?

  • Thomas Dolberg 74 posts 95 karma points
    Feb 14, 2011 @ 20:38
    Thomas Dolberg
    0

    Yup,

    check out umbraco.cms.businesslogic.Tags

     

    best regards

    Thomas

  • Simon Kibsgård 62 posts 73 karma points
    Feb 16, 2011 @ 07:54
    Simon Kibsgård
    0

    Well that umbraco.cms.businesslogic.Tags class will only manipulate the tags and relations in the database. We need to also republish the affected nodes. It seems that my code above will actually republish those nodes, but changes to the tags aren't made. I suspect, that the cms ui does something else to push the correct tags to the nodes that has nothing to do with Document publish?


Please Sign in or register to post replies

Write your reply to:

Draft