Parse json url in javascript to get options in RTE from data source | Community
Skip to main content
March 8, 2019
Solved

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

  • March 8, 2019
  • 5 replies
  • 1817 views
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 Rel Attribute Select  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().
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Aem_Rockstar

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); }); } });

5 replies

smacdonald2008
March 8, 2019

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

March 8, 2019

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

Gaurav-Behl
March 8, 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

});

smacdonald2008
March 8, 2019

Gaurav is correct - you need to implement JavaScript logic.

Aem_RockstarAuthorAccepted solution
March 13, 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); }); } });