To retrieve data (configuration, translations) from AEM for it to be available in the context of fragment rendering in Knot.x you have to use one of following appoaches:
AEM can directly render its data into the template inside knot.x snippet - the easiest way and the messiest one at the same time, we're mixing two different rendering engines in one place (HTL and handlebars), also you can't process this data together with data from services
render AEM data as JSON in the data-knotx-params attribute - that's fine unless there are multiple handlebars snippets on the page where you have to provide the same parameters in every snippet in order to avoid multiple executions of the same service
custom knot - it would retrieve data from AEM, cache it and enrich all fragments - but you have to develop a custom knot, add it to the chain and prepare a special resource/servlet on AEM returning required data, additionally it requires another roundtrip in addition to template retrieval
retrieve data within a service - additional roundtrip, you have to manage the cache yourself
What I would like to achieve is the following scenario:
define Sling Model which retrieves all required data from JCR
render that data as JSON within Githubissues.
Githubissues is a development platform for aggregating issues.
To retrieve data (configuration, translations) from AEM for it to be available in the context of fragment rendering in Knot.x you have to use one of following appoaches:
What I would like to achieve is the following scenario: