Skip to content

Open view links in the current browser tab #10220

Closed Answered by brandonkelly
MoritzLost asked this question in Ideas
Discussion options

You must be logged in to vote

This is a tricky one… the preview links can’t really be pre-generated (or generated on click) because they are tokenized, and the token needs to be saved on the back-end in order to work, and it’s probably not a good idea to pre-generate a new preview token every time an Edit Entry page is loaded.

However I just came up with a semi-clever solution: we are now pre-generating the random 32-character token string during page load, so now the JS knows what the final tokenized URL will be once the token has been “activated” (saved in the back-end). Thanks to that, the View button can now be an <a> tag that initially links to the preview/create-token controller, passing the pre-generated token …

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@MoritzLost
Comment options

@brandonkelly
Comment options

@michaelroper
Comment options

@brandonkelly
Comment options

Answer selected by brandonkelly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
3 participants
Converted from issue

This discussion was converted from issue #10218 on December 07, 2021 12:05.