Hello Team,
I have a requirement to show up the tags only for tag path /etc/tags/facebook/work. I played with tagsBasePath as /etc/tags/facebook/work to get only facebook work tags displayed. But when I click on the tag to get added, tag is not getting added. When I digged into the code, I am seeing the following error. I am not sure If I should not change the tagsBasePath and please help me how to achieve my functionality.
loadTagNamespaces: function() {
this.tagNamespaces = {};
var tagJson = this.loadJson(this.tagsBasePath + CQ.tagging.TAG_LIST_JSON_SUFFIX + "?count=false");
if (tagJson && tagJson.tags) {
CQ.Ext.each(tagJson.tags, function(t) {
this.tagNamespaces[t.name] = t;
}, this);
}
this.setupPopupMenu();
this.tagNamespacesLoaded = true;
}
facebook:work/employer/305115773870 -- nsTagId
getNamespaceDefinition: function(nsTagID) {
if (!this.tagNamespacesLoaded) {
this.loadTagNamespaces();
}
var nsName = CQ.tagging.parseTagID(nsTagID).namespace;
return this.tagNamespaces[nsName];
}
Here as a result : I am getting the getNamespaceDefinition function returning the value as undefined.
checkMaximum: function(tag) {
var ns;
if (typeof tag === "string") {
// new tag
if (this.displayTitles) {
ns = this.getNamespaceDefinitionByTitlePath(tag);
} else {
ns = this.getNamespaceDefinition(tag);
}
} else {
// existing tag
ns = this.getNamespaceDefinition(tag.tagID);
}
if (ns === null) {
// if the namespace is not found, we can't change for a maximum and have to accept it
return true;
}
var cfg = this.getNamespaceConfig(ns.name); -- ns.name of undefined is giving the above error for which I have provided the stack trace.
...
}
values that I got out of debug:
Best Regards,
Durga
Solved! Go to Solution.
Views
Replies
Total Likes
Ah - out of the box there is no way to achieve your requirement - you'd have to create a new workspace and put those tags in that workspace.
Or you'd have to extend the tag input widget and add the filtering capability.
Views
Replies
Total Likes
You don't want to use the tagsBasePath property - you want to use the namespaces property. It's an array of strings representing the namespaces you want to be displayed. See http://dev.day.com/docs/en/cq/current/widgets-api/index.html?class=CQ.tagging.TagInputField for details. You wold set the property to facebook in your case.
Views
Replies
Total Likes
Thanks Paul for your reply. I tried the namespaces property also. But all the tags are maintained under one namespace facebook. I have attached the screenshot for your reference.
My requirement is to refine/display the certain tags with in the name space. for eg: /etc/tags/facebook/work
Views
Replies
Total Likes
Ah - out of the box there is no way to achieve your requirement - you'd have to create a new workspace and put those tags in that workspace.
Or you'd have to extend the tag input widget and add the filtering capability.
Views
Replies
Total Likes
Thanks Paul for your suggestion. Even I am thinking of extending the CQ.tagging.TagInputField
Views
Replies
Total Likes
Views
Likes
Replies