I have a preview target like this:
@previewUrl/live-preview/fooBar/{uid}
Instead of giving me the uid of the entry, I am getting some weird uid (maybe the uid of the draft). Is there a way to get the standard uid?
Yeah, it鈥檚 the draft鈥檚. Change to {sourceUid} and it will return the real entry UID.
@brandonkelly, thanks! Is that documented anywhere?
It is now :)
https://docs.craftcms.com/v3/sections-and-entries.html#preview-targets
If you want to include the entry鈥檚 ID or UID in a preview target URL, use
{sourceId}or{sourceUid}rather than{id}or{uid}, so the source entry鈥檚 ID or UID is used rather than the draft鈥檚.