contentacms / contenta_jsonapi

Contenta CMS, the decoupled Drupal
http://www.contentacms.org/
GNU General Public License v2.0
328 stars 103 forks source link

Image Styles in json api response #344

Closed CosyStudios closed 5 years ago

CosyStudios commented 5 years ago

First up, good work everyone involved here. I finally got round to having a proper play with contenta and the accompanying json api library in angular. The project is most definitely in the right path and impressively concise and on point.

Forgive me for being incorrect/uninformed but image styles are a critical aspect of my development but don't yet seem to be supported in the json responses. I recall this issue having existed for RESTws some years back and finding a workaround to add image styles to the output.

Noted the consumer implementation and i think this is certainly the way to go. Though there's no release for consumer_images that's compatible with the current contenta json_api release.

Are there any other solutions going around the table regarding image styles / general image optimisation? I cant be the only one who thinks this is critical

Currently tempted to go back to drupal 7 where i know have a working architecture for headless projects albeit restws based but id really like to start taking contenta seriously for future.

Kindest regards, Bob

CosyStudios commented 5 years ago

Silly me. Managed to rebuild using the previous branch where consumer_image_styles is included.

...Now just have to figure out how to get angular2_jsonapi to deliver the image style in its meta!!!

e0ipso commented 5 years ago

Support for image styles was recently added back and it's still experimental. However it's now compatible with JSON:API 2.0.

CosyStudios commented 5 years ago

Interesting. Well, happy that my current build is doing what it needs.

Only problem now is that angular2-jsonapi doesn't include the meta data in its responses for single records. Going to have an experiment at rewriting some of its classes later to see if i can botch a solution. Annoying, you can see the meta data and derivatives getting returned in the network call but angular2-jsonapi's model doesn't include any of it. There is ngx-jsonapi to consider but i prefer angular2-jsonapi 's approach and syntax, nor am i certain it includes meta either ! !

Maybe i should just consider cloudinary or something. I thought responsive image styles was like everyones priority. Its more or less the fundamental reason why im using Drupal and not nodejs or anything else as a backend