Question: How to use Display.RenderTemplates as directives and get it working
See original GitHub issueHi guys,
I’m currently trying to integrate some display responses and wanted to use the Display.RenderTemplates from the Alexa Skills Kit. My problem is, I can’t get it working. Unfortunately, the documentation isn’t really detailed in this point, it just says
The response.directive(Object directive) method allows you to set custom directive objects to devices to perform a specific device-level actions. The full specification for the directive object passed to this method can be found here.
So, here’s the code of the latest of my tries:
response
.card({
type: 'Simple',
title: 'Test Title',
content: 'short text'
})
.directive({
type: "Display.RenderTemplate",
template: {
type: "BodyTemplate1",
token: "token1",
backButton: "VISIBLE",
title: "rendertemplate title",
textContent: {
primaryText: {
text: `<b>Name:</b> John`,
type: "RichText"
},
secondaryText: {
text: `<b>Phone:</b> 08163/2534`,
type: "RichText"
},
tertiaryText: {
text: "<i>Powered by my awesome skill</i>",
type: "RichText"
}
},
}
})
.directive({
type: 'Hint',
hint: {
type: 'PlainText',
text: 'test hint'
}
})
.say('this is the answer you want to hear')
.shouldEndSession(false)
.send();
Well, this code doesn’t work, my Echo Show says there was a problem with the answer of the skill.
So, could anyone show me a working example of such a DisplayTemplate directive please?
Best regards, Benjamin
Issue Analytics
- State:
- Created 5 years ago
- Comments:12
Top Results From Across the Web
AudioPlayer.Play + Display.RenderTemplate directive, template ...
I passed AudioPlayer.Play and Display.RenderTemplate directives,. when launching skill via echo show, it displays my template for like ~2 seconds and when ...
Read more >Display Interface Reference | Alexa Skills Kit
This reference describes how to use display templates in the skill service code to achieve the look and ... RenderTemplate and other directives...
Read more >Echo Show python skill not generating display template
Show activity on this post. This worked for me in python. But not able to render the list template. def build_response(session_attributes ...
Read more >Screens | litexa
If they are, the APL directive(s) will take precedence and the Display.RenderTemplate directive will be removed! # Installation. The module can be installed ......
Read more >Alexa Skills Kit SDK for Node.js - npm
Start using alexa-sdk in your project by running `npm i alexa-sdk`. There are 22 other projects in ... RenderTemplate directive in response.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The directive method just passes thru whatever json you provide, so you need to validate that your json is correct. You can do this manually in the simulator or thru the SMAPI. Are you testing on a device with display capability? Have you enabled that in your skill configuration? You can’t return display directives unless your skill declares that it requires that API. Here’s a working call to directive for one of my skills:
@patrickbussmann Did you manage to make it work? AFAIK the supported markup does not include setting the text’s color. Hopefully we get this functionality in the future…