Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

How to get content path (asset path) in addtag listener of cq:tags in classic ui?

Avatar

Avatar
Validate 1
Level 1
deepalakshmip35
Level 1

Likes

0 likes

Total Posts

6 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Affirm 1
View profile

Avatar
Validate 1
Level 1
deepalakshmip35
Level 1

Likes

0 likes

Total Posts

6 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Affirm 1
View profile
deepalakshmip35
Level 1

09-03-2018

We have some validation while adding tags in asset metadata, so this validation taken care in addtags listener of cq:tags.

Now got a requirement to restrict this addtag validation for one particular content path. So while I try to get contentPath from inputField, but it always comes as null.

Please suggest how to get current content (asset) path in addtag listener of classic ui. AEM version: AEM6.2.SP1-CFP9.

addtag:

function(inputField, tag) {

console.log(inputField);  --> it has contentPath property, but has null value always

contentPath =  inputField.contentPath;

console.log(contentPath);

}

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
Level 1
deepalakshmip35
Level 1

Likes

0 likes

Total Posts

6 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Affirm 1
View profile

Avatar
Validate 1
Level 1
deepalakshmip35
Level 1

Likes

0 likes

Total Posts

6 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Affirm 1
View profile
deepalakshmip35
Level 1

14-03-2018

Finally I found to got way to get the content path in addtag listener of tag type in asset metadata editor:

function(f) {

contentPath = f.findParentByType("asseteditor").path;

console.log(contentPath);

}

Answers (0)