0

I need to create a REST Export view which can display 1 revision of each item of content of a particular content type. I need to be able to change which revision is displayed between the current published version and the latest version (whether that is a draft, published, etc). Ideally, choosing between published and latest would be done via the query string of the api call.

I've played around with the filters Latest Revision, Default Revision and more, but I can't figure out a solution.

2
  • Could you give some examples of what you have tried. If the issue is setting a GET variable request then this post might help mycode.blog/lakshmi/…
    – purencool
    Mar 7 at 6:00
  • I've found a solution that involves nesting Views, but I feel like there must be a better way of doing it. My first Content View just selects NID and uses that as a contextual filter for the embedded view. The 2nd Content Revisions View has all the data fields I need and limited to 1 item. Both views have filters exposed for Default Revision and Published. If the filters are null, I get most recent revision, if both =1 I get the current published version. However the JSON output is ugly with extra layers and arrays for single items.
    – Steve
    Mar 7 at 8:47

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.