I believe the library sets a freetag's ID
to the same as its name
as a default, the only way to change that would be to edit the add_freetagging_tokens()
method within the library.
At the point it is called, the token is nothing more than a string, so to change the name, you could simply do this:
onFreeTaggingAdd: function (item) {
$.post("../php/add_tagg_02.php", {tag: item, userid: "userid-dummy"} )
.done(function(data, status, xhr) {
alert ("Your suggested new tag " + data.name + " is entered in the database and will be considered for future use.");
console.log( data.name ); //returns the "new" name from the api
console.log( data.id ); //returns the id provided by the api
})
return data.name; //Sets the tokens Name/ID to be the new name from the api.
},
If you did want to also customize the ID, it should be relatively simple to change the method to return an object, instead of a string.
Also be aware that this token obviously won't be searchable for, unless you also update your data source.