I've built a help site for a client that pre-releases articles to a select group of beta users. The updated articles (Craft entries) are published as drafts until features make it out of beta and into the main release.
The client has gone and done the clever thing of using the Live Preview URL (with token) to share with the limited group of beta users who should only have read-only access to the article:
http://cagedwisdom.com/articles/bloopers?token=3p~rKL53nTcTrO_q1XcWsaBNla5VpzTF
Since the token is temporary, this link works for a little while and eventually expires and people can no longer review the draft content.
Is there a way to an entry's latest draft?
Let's pretend that I have a the query parameter &draft=true
appended to an article URL, and I use that to selectively get the latest draft:
{% if craft.request.getParam('draft') == true %}
{% set draftEntry = entry.drafts().order('date desc').first() %}
{% endif %}
Is there a not-imaginary way to do this?
If not, my best ideas are...
- To create a plugin that'd allow the editor to create a persistent but removable hash for that specific entry that'd allow access to said draft. (So if the article URL is
http://cagedwisdom.com/articles/bloopers
, the secret draft share URL would behttp://cagedwisdom.com/articles/bloopers&draft=Ag4For3Wom8Ot5eeDd9yAf2g
.) - Mess with Craft's token expiration values so the shared links last longer.