You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Live preview sidebar doesn't update if slug updates #13055
I believe this might be a difficult one to fix, now that the live preview is attached to the document root, if you create a document and then type a title to generate a slug, the live preview doesn't update to that slug as it takes the URL when the live preview mounts.
I'm not entirely sure how to fix this as refreshing on form changes could cause performance problems.
My suggestion would potentially add a refresh button here;
Or revalidate the URL on toggling live preview. In the meantime I believe this could be fixed in the FE.
@PP-Tom this was always an issue, even before mounting live preview to root. This is something I've always wanted to fix. If your URL relies on dynamic data from the document, it needs to be refreshed. See #12785
I'm not entirely sure how to fix this as refreshing on form changes could cause performance problems.
This is true, but technically it would only run when a field changes that might affect the url. There are ways to optimize this, like only generate the slug on initial create or when explicitly requested, not on every keypress. This specific issue is being addressed here: #12956
But the other performance implication here is running the live preview url function itself. We either need to run it on every form state change, or find some pattern for opt-in to re-running it when certain criteria are met.
Then if the URL does in fact change, we'd also need to reestablish a connection to the preview window.
Thanks for the insight @jacobsfletch, I didn't come across this before personally as I would create the title (generating the slug) and then click "Live Preview", in which now that isn't possible as clicking "Live Preview" doesn't refresh anything as it did before because you changed route.
Previously if you were in live preview and then created a slug, you would face the same problem. But now the only way is to create the slug and either come out of the document and go back in, or refresh the browser.
That's why I was thinking a refresh button on the Live Preview responsive bar could be a quick way around this as it doesn't mean you have to come out of the document in anyway.
I'm interested in the creating a slug on initial create though, would this be similar to say Storyblok where you have to define a title and slug before creating the document?
Maybe give us form data onRefresh in live reload, and then we can opt in to generate a url from the form and do a navigation, currently onRefersh takes no args.
That's why I was thinking a refresh button on the Live Preview responsive bar could be a quick way around this as it doesn't mean you have to come out of the document in anyway.
I'm not opposed to this. Would be a good feature either way!
I'm interested in the creating a slug on initial create though, would this be similar to say Storyblok where you have to define a title and slug before creating the document?
Not quite, just imagine a hook that auto populates the slug only if it doesn't exist yet. Autosave is where this gets tricky, though.
I'm going to close this issue as a duplicate of #12785 which was opened first. Didn't see this before. But I'm actively working on it in #13631, let's track progress there.
Activity
jacobsfletch commentedon Jul 7, 2025
@PP-Tom this was always an issue, even before mounting live preview to root. This is something I've always wanted to fix. If your URL relies on dynamic data from the document, it needs to be refreshed. See #12785
This is true, but technically it would only run when a field changes that might affect the url. There are ways to optimize this, like only generate the slug on initial create or when explicitly requested, not on every keypress. This specific issue is being addressed here: #12956
But the other performance implication here is running the live preview url function itself. We either need to run it on every form state change, or find some pattern for opt-in to re-running it when certain criteria are met.
Then if the URL does in fact change, we'd also need to reestablish a connection to the preview window.
PP-Tom commentedon Jul 7, 2025
Thanks for the insight @jacobsfletch, I didn't come across this before personally as I would create the title (generating the slug) and then click "Live Preview", in which now that isn't possible as clicking "Live Preview" doesn't refresh anything as it did before because you changed route.
Previously if you were in live preview and then created a slug, you would face the same problem. But now the only way is to create the slug and either come out of the document and go back in, or refresh the browser.
That's why I was thinking a refresh button on the Live Preview responsive bar could be a quick way around this as it doesn't mean you have to come out of the document in anyway.
I'm interested in the creating a slug on initial create though, would this be similar to say Storyblok where you have to define a title and slug before creating the document?
joetifa2003 commentedon Jul 13, 2025
Maybe give us form data onRefresh in live reload, and then we can opt in to generate a url from the form and do a navigation, currently onRefersh takes no args.
fix(templates): only generate slug from title on demand (#12956)
jacobsfletch commentedon Aug 27, 2025
I'm not opposed to this. Would be a good feature either way!
Not quite, just imagine a hook that auto populates the slug only if it doesn't exist yet. Autosave is where this gets tricky, though.
I'm going to close this issue as a duplicate of #12785 which was opened first. Didn't see this before. But I'm actively working on it in #13631, let's track progress there.
github-actions commentedon Sep 5, 2025
This issue has been automatically locked.
Please open a new issue if this issue persists with any additional detail.