kirby-json-api icon indicating copy to clipboard operation
kirby-json-api copied to clipboard

How could I return "coverimage" with URL instead of filename?

Open ray-su opened this issue 8 years ago • 1 comments

Hello, Thanks for this great plugin. by default, the ""coverimage", will only return the filename eg. "coverimage": "extending.png", How can I make it return with the image url instead? I have no experience with PHP, so Im not too sure how to implement this. Thanks

ray-su avatar Sep 05 '17 18:09 ray-su

I think I found a temporary solution, by adding this line 'content_url' => new StaticField($page->contentURL()), Now the it will return "content_url": "http://localhost:8888/kirby/content/2-blog/20160802-extending-kirby", "coverimage": "extending.png",

and then I can just do content_url+'/'+coverimage

ray-su avatar Sep 05 '17 20:09 ray-su