Parse json url in javascript to get options in RTE from data source

Avatar

Avatar

Aem_Rockstar

Avatar

Aem_Rockstar

Aem_Rockstar

08-03-2019

I am trying to get options values from "/etc/acs-commons/lists/list/_jcr_content.list.json"  in RTE dropdown.
Experiencing Adobe Experience Manager - Day CQ: AEM 63 - Touch UI Extend Rich Text Link Dialog, Add ...  I am going through this but trying to get options parsing from datasource. Please help me how to get those values in this funtions getLinkRelOptionsHtml().

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

Aem_Rockstar

Avatar

Aem_Rockstar

Aem_Rockstar

13-03-2019

This worked for me

$.ajax({ url: "/etc/acs-commons/lists/list/_jcr_content.list.json",

        dataType: 'json',

        async: false,

        success: function(data) { $.each(data, function(i,value) { html = html + getOptionHtml(value); }); } });

Answers (4)

Answers (4)

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K
smacdonald2008

08-03-2019

Gaurav is correct - you need to implement JavaScript logic.

Avatar

Avatar

Gaurav-Behl

MVP

Total Posts

1.1K

Likes

226

Correct Answer

281

Avatar

Gaurav-Behl

MVP

Total Posts

1.1K

Likes

226

Correct Answer

281
Gaurav-Behl
MVP

08-03-2019

Not sure if this helps in what you're looking for --

$.getJSON( "/etc/acs-commons/lists/list/_jcr_content.list.json", function( data ) {

JSON.parse(data); 

// do something with parsed values or inject it into RTE DOM

});

Avatar

Avatar

Aem_Rockstar

Avatar

Aem_Rockstar

Aem_Rockstar

08-03-2019

Thanks donald. This example is working fine. I wanted to get options from data source i.e from an admin screen.

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K
smacdonald2008

08-03-2019

This article has a package - did you install the package to get this example working.