marcinczeczko on 398-config-defaults
marcinczeczko on backpressure-and-configs
Reorganized standaolone & examp… Merge branch 'milestone/backpre… Set a version of target release and 16 more (compare)
marcinczeczko on 398-config-defaults
Set target version for this bra… Merge branch 'milestone/backpre… (compare)
marcinczeczko on backpressure-and-configs
Set target version for this bra… (compare)
marcinczeczko on 398-config-defaults
Documentation fix. #394 Added encoding of uri para… Write a test case for requestin… and 5 more (compare)
When we talk about the image there is no issue with handbars usage - you need to provide image url and description. Your service can responsd with:
{
"banner": {
"url": "http://domain/path_to_image",
"description": "Some description"
}
}
Then you can simply consume the service response in your html template (which is fetched from remote repository):
<script data-knotx-knots="services,handlebars"
data-knotx-service="targetservice"
type="text/knotx-snippet">
<img src="{{_result.url}}" alt="{{_result.description}}"
</script>
Look at http://knotx.io/blog/hello-rest-service/ where you have nice step by step description.
If we talk about providing full HTML markup for your banner or other targeted component I recommend you to write dedicated extension (called Knot: https://github.com/Cognifide/knotx/wiki/Knot#how-to-implement-your-own-knot). It can call the targeting service which responds with HTML (not JSON) and then put it as fragment content (simply replace fragment markup). To be honest we have a similar solution in our plans. We have the dedicated repository for that extensions: https://github.com/Knotx/knotx-extensions.
Could you please create an issue in this repository and describe your use case
in details. It will help us when we will prepare backlog for the next milestone.
"knotx:io.knotx.FilesystemRepositoryConnector": {
"options": {
"config": {
"catalogue": "./library/"
}
}
}
"knotx:io.knotx.HttpRepositoryConnector": {
"options": {
"config": {
"clientDestination": {
"domain": "localhost",
"port": 80
}
}
}
}
"knotx:io.knotx.KnotxServer": {
"options": {
"config": {
"repositories": [
{
"path": "/content/.*",
"address": "knotx.core.repository.http"
},
//routing, etc.