Closed Synj24 closed 6 years ago
I'm guessing this is a problem with your data rather than the library. I have a test for this use case that has pretty much the same template.
I was poking around the raw API endpoint that your data is getting pulled from, and it looks like you don't have any posts that have the category news
. So I would just assume that the API is not returning anything, which would explain why spike throws an error when trying to access the title
prop of an item
which doesn't exist. Hope that helps!
It's rendering the posts else where though. I'm aware the slug is different from the name and i thought this might be causing problems but i also tried with features
and still no luck.
{
"found": 3832,
"posts": [
{
...
"categories": {
...
"Latest News": {
"ID": 2,
"name": "Latest News",
"slug": "news",
"description": "The latest news from the live event production world",
"post_count": 3154,
"meta": {
"links": {
"self": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/93531691\/categories\/slug:news",
"help": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/93531691\/categories\/slug:news\/help",
"site": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/93531691"
}
},
...
"categories": {
"Features": {
"ID": 3,
"name": "Features",
"slug": "features",
"description": "All the in-depth AAA features",
"post_count": 248,
"meta": {
"links": {
"self": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/93531691\/categories\/slug:features",
"help": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/93531691\/categories\/slug:features\/help",
"site": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/93531691"
}
},
"parent": 0
},
Thanks for your help anyway :bowing_man:
I'm not 100% sure if this is an issue with this plugin specifically as there is also a similar issue with the spike-datocms plugin.
When i'm trying to render my posts to a template:
app.js
article.sgr
spike throws an error:
I've tried to
JSON.stringify(item)
also but this returns undefinedHeres a link to my repo incase you wanted to reproduce this error.
Apologies if this issue is unrelated to your plugin. Thanks :^)