Copied to clipboard

Flag this post as spam?

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


  • sim0n20 7 posts 27 karma points
    Jan 09, 2011 @ 16:28
    sim0n20
    0

    RemoveTagsFromNode

    Would anyone be able to confrim whether any of the following methods work in relation to deleting tags progamatically

    public static void RemoveTagFromNode(int nodeId, string tag, string group);

    public static void RemoveTagsFromNode(int nodeId);

    public static void RemoveTagsFromNode(int nodeId, string group);

    I have tried all 3 without success. I have been able to use the RemoveTag() method but i dont want to remove the tag itself, only the relationship between the tag and a node.

    Cheers

    Simon

     

     

     

  • sim0n20 7 posts 27 karma points
    Jan 12, 2011 @ 11:38
    sim0n20
    0

    Still scratching my head with this one. Anyone have any ideas?

    Thanks

    Simon

     

  • jeffreypriebe 4 posts 29 karma points
    Apr 14, 2011 @ 22:05
    jeffreypriebe
    0

    I had a similar issue. I was trying to remove a single tag from a node (like you, just the relationship with the node, not remove the tag entirely).

    To no avail. Occasionally it seemed to work, but was generally iffy (at best). Seems like a bug in Umbraco (you'll find other references to generally sketchy tag behavior in Umbraco [TagService, etc.]). I am working with Umbraco v 4.5.2 so maybe it is fixed in a newer version (current most recent version if 4.7).

    What worked for me:

    RemoveTagsFromNode - which just cleared all tags - which was fine, since I could recreate just the ones that I needed. A bit of extra work to figure out and potentially could go further awry (if, for some reason, the code fails to add the wanted tags back in... then you're left with no tags at all), but it did work for my trick.

    Again:

    Instead of: Removing a single tag with the generally non-compliant: RemoveTagFromNode...

    What worked: Remove all tags with RemoveTagsFromNode (check the Tag property for existing values first) - and then add back in the wanted tags with AssociateTagToNode.

     

    Jeffrey

Please Sign in or register to post replies

Write your reply to:

Draft