I'm looking to create tags programmatically. I've done it through a direct DB insert
but that doesn't seem to be working correctly as I can't associated those created tags with a piece of content via the observer.
I'm looking for something like this:
$content = JTable::getInstance("Content", 'JTable', array());
$content->load($id);
JHelperTags::addTags(array("tag1", "tag2"), $content);
JHelperTags
has a method that may do what I want, but I don't understand the arguments. The following does not work
$h = new JHelperTags();
$h->tagItem($content->id, $content, array("tag1", "tag2"));
How can I programmatically create tags that will be correctly stored in Joomla?