Preview URL for schemas feature clarification


Wanted to try the “preview URL for schemas” feature today (awesome that this has been implemented by the way) … got it to work (I think) but not sure I’ve configured it correctly.

This is what I did:

  1. Update Squidex Client library (had an old one)
  2. Added relevant code from “Step 1: Query unpublished content in your application” from to my consuming application
    My Get method signature:
    public async Task<IActionResult> OnGet(string slug, bool preview = false)
    var context = QueryContext.Default.Unpublished(preview);
    var posts = await client.GetAsync(filter: $"data/slug/iv eq '{slug}'", context: context);
  3. Fixed this line: var posts = await client.GetAsync(filter: $"data/slug/iv eq '{slug}'", context: context); VS wouldn’t compile because of a syntax error - context: was missing.
  4. Modded my schema; added the following preview URL: Localhost https://localhost:12345/${data.slug}?preview=true Notice I appended the URL with ?preview=true. This part is not in the docs. Is it needed? I guess so.

So this is my config / steps that I did to be able to preview unpublished content. Am I doing it right?

Also, just some feedback regarding the docs on

I think that it needs a little more work. Maybe a more detailed step by step. And maybe add some references to the repo too; such as And also maybe add a link to this thread

Thank you for the feedback. Documentation is a big topic for me.

  1. Sorry
  2. Yes, good point, it is not mentioned in the docs.

I will have a look but your approach looks okay to me. Do you have unpublished content for this item?

Awesome, thanks Sebastian. Yes, the content that I tested this with is unpublished. Seems to be working fine. Please give a shout if you need more feedback on the docs.

It is working fine? Now I am confused :smiley:

Oh, btw: There is another property called DataDraft that contains the unpublished version of the content. There is a pull request for that ( But I am waiting for changes.

Btw: Pull requests for the docs are even better than feedback :wink:

Yes, all is working fine. Most stable squidex version so far for me btw.

Got no time for dox pr atm unfortunately. :pensive: