Fetch document author

Hi there,

Is it possible to query the author who created the document?

Hello @feicht.marco

Welcome back to the Prismic community, and thanks for reaching out to us.

If I understood your question, you want to query the author of the documents. Currently, it's not possible to query the author who created the document. I will let my @features-team know about this for future improvements.

But you can get the author's detail on your pages by following this:

  1. Create a page and author documents in the Prismic.
  2. Give the Content relationship field in the page Custom-Type. So in the page documents, you can use this field to link to the author's document.
  3. Now, you need to use fetchLinks in your code. fetchLinks fetches a specific content field from a linked document. Find more detail here .

This is in javascript, but you can find documentation in the different frameworks as well. What framework are you using?

Could you please give me more detail about your use case?


Hi @Priyanka

Thanks for your guide. I was looking for a function like in WordPress where the user who creates the post is automatically added as post author. That would be a great Prismic feature!

But the solution with a custom type to manage the authors is also good for now.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.