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.
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.
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
Still scratching my head with this one. Anyone have any ideas?
Thanks
Simon
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
is working on a reply...