How to display part of current URL within cq dialog field.

Avatar

Avatar

kevinc55336069

Avatar

kevinc55336069

kevinc55336069

25-04-2019

I created a component for placing advertisements that is being shared in several containers on different pages of my site. The component has a cq dialog for the author to choose an ad image and insert a link that the image will direct to when clicked. I am now tasked with creating a field in that component/dialog that assigns a unique tag to each ad according to the page the ad is on.

I have tried using js to grab the last part of the current URL and have that value displayed, but am stuck. Can anyone give me a helping hand?

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Reply

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Reply

2.3K
smacdonald2008

25-04-2019

You can develop very powerful custom resource types that you can drop into a component dialog. This is done via JS. We have an example of creating a custom resource type here: Adobe Experience Manager Help | Creating a custom Experience Manager 6.4 sling:resourceType for Touc...

Answers (0)