This has really stumped me, not sure why I cant get it working.
I have an a variable called 'posts'. Which contains the following.
array(2) { ["data"]=> array(5) {
[0]=> array(3) {
["full_picture"]=> string(98) "https://www.website.com/picture.jpg"
["message"]=> string(613) "long message here"
["id"]=> string(32) "000000000" }
[1]=> array(3) {
["full_picture"]=> string(98) "https://www.website.com/picture.jpg"
["message"]=> string(613) "long message here"
["id"]=> string(32) "000000000" }
[2]=> array(3) {
["full_picture"]=> string(98) "https://www.website.com/picture.jpg"
["message"]=> string(613) "long message here"
["id"]=> string(32) "000000000" }
[3]=> array(3) {
["full_picture"]=> string(98) "https://www.website.com/picture.jpg"
["message"]=> string(613) "long message here"
["id"]=> string(32) "000000000" }
[4]=> array(3) {
["full_picture"]=> string(98) "https://www.website.com/picture.jpg"
["message"]=> string(613) "long message here"
["id"]=> string(32) "000000000" }
}
["paging"]=> array(2) {
["previous"]=> string(324) "website.com/link"
["next"]=> string(306) "website.com/link" }
}
I want to use twig to display the values in the nested arrays within the data array using twig markup.
At the moment I have the follow
{% for post in posts %}
{{ post.data.message }}
{{ endfor }}
I have also tried the following with no success.
{% for key, post in posts %}
{{ post.data.message }}
{{ endfor }}
any guidance on where i am going wrong would be great. Thanks.