My problem is simple, still did not find any solutions…
I would like to show some post on other pages than the homepage. It works until the homepage is loaded first. If I refresch that specific page, the data of all the post are not loaded.
I am using:
const data = state.source.get("/");
I also tried:
state.source.data
but nothing…
Can you be more specific about what your are trying to do ? What is the specific page ? An archive page ? Can you provide some code or better a codesandbox ?
Thanks for your response. I am trying to show some of the blog posts on some custom pages I have created on my Frontity website. Similar thing as I have done already on the homepage. Imaging it like creating multible homepage but on custom pages (non-wp pages).
I can share my github link to the project I have created if that helps.
I’m no expert but from what I understood state.source.get() is there to get data , usually with actions.source.fetch.
But you are using it in the wrong way, you don’t need to manually fetch posts , as Frontity already do this for you in state.source.post, it will fetch the first 10 posts (can be changed, I use 20 in my last blog)
Instead just do const mySexyPosts = state.source.post,
this will return an array of object with your posts
and should avoid your issue.
State.source.get is really handy when you need to query some specific data but that’s also the reason why you can’t access your posts directly, state.source.get means in your case “return homepage data”
but fetching homepage can be useful to preload data