kirby3-autoid icon indicating copy to clipboard operation
kirby3-autoid copied to clipboard

Support drafts

Open bnomei opened this issue 3 years ago • 3 comments

bnomei avatar Feb 21 '21 18:02 bnomei

Hi, wondering if there are still plans to support drafts. I'm using this plugin to create relationships between draft pages before publishing everything, but the lack of drafts support is causing display issues in the panel UI.

Thanks

pichiste avatar Mar 09 '22 13:03 pichiste

as far as i can tell from my last commits in feb 21 i switched to kirbys core lookup for drafts. i am not sure why i did not close this issue back then. seems done. 🤷‍♂️

what exactly does not work for you in the panel?

bnomei avatar Mar 10 '22 18:03 bnomei

Hi @bnomei, thanks for your response. Basically, in a section blueprint I want to display the title of a related page like this:

info: "{{ page.people.toStructure().first.foreignkey.fromAutoID().title }}"

...where foreignkey is a valid autoid.

This works fine when the page of that autoid is published, but not when it is a draft.

The reason seems to be that the autoid() helper (used by fromAutoID), doesn't work with drafts, at least according to the docs: "autoid()-helper will not find drafts, so make it unlisted/listed" https://github.com/bnomei/kirby3-autoid/wiki/PHP:-autoid(),-Field-Method-fromAutoID()#create-a-pagefile-programmatically-and-retrieve-autoid

pichiste avatar Mar 11 '22 08:03 pichiste