We've been using Prismic for our blog - Blog | 360Learning. Very happy with the product so far. However, our content manager has reported a weird behavior of the Prismic toolbar when visiting some blog page while being logged in Prismic.
Basically the toolbar is not displaying the right main document.
For instance, we've got a custom type for articles, and if I check this article here - The Right Way To Do Training Needs Analysis - the main document identified is the navbar as you can see on attached screenshot
We had a look at this and we could see that you were using Nuxt, for static generation weāre guessing. From a bit of digging we came to the conclusion that it seems you are doing static queries for your documents but maybe not for you menus etc.
The edit button script learns from the queries made and documents returned what is the main document. So this can cause issue when the site is being statically deployed.
It would be really interesting if you could show us how you are doing the queries for you menus and blog posts. This would be a good start to debugging this.
So looking in to it a little more, Iām seeing similar behaviour when using or multi-page example when going through the nuxt-links to the homepage, if I refresh the page the edit button is finding the correct main document.
When we did checks on your blog the blog query wasnāt appearing in the dev mode, so Iād love to investigate more as Iām not completely sure exactly where the issues stems. Is there any way you can send me the project in a zip or a Github link in a private message so I can debug more?
We are also having the same exact issue. We have a Nuxt 2.13.3 application statically generated, which, while in development mode, the Prismic toolbar sometimes only shows 1/2 types on the page. For example, we have a āhomeā single type and a āservicesā repeating type, and both are being rendered on the page, but the toolbar only shows āservicesā.
I checked your project and could indeed reproduce this, but only on the homepage, all the blog pages work fine.
Iām not sure if itās linked to the fact itās statically deployed, with the banner queried first in the store or because your homepage is made almost entirely of context relationships or a mix of both.
But Iāve explained it to the Dev team so they can investigate and hopefully theyāll have a more educated answer than my what Iāve given you here.
Thanks @Phil yes, pretty much every page uses a content-relationship, with the āMain Documentā being the first related doc. Like Jeremy, I also use asyncData in my nuxt app to fetch the main doc.
Weāre also getting the wrong Main document when using the PHP toolkit. In our case, we have a Footer document that is appearing as the Main document. Is there an articulation of the logic that is used to determine the Main and related documents? Or a way to explicitly define them?
This is being tracked as an open issue in the tracker. It's seems to be an issue with how the toolbar predicts the main document through queries, when the team has more information they'll update you in this thread.
Though I think it will require some updates to the toolbar. I also think @benji 's suggestion of somehow defining the main doc could be interesting, so I've added this as a feature request in the issue tracker.
Sorry for the inconvenience this is causing in the main time.