sylvainjule / kirby-autofocus

Content aware image cropping for Kirby. Kirby 2 and 3.
41 stars 2 forks source link

$page is null #6

Closed tristantbg closed 5 years ago

tristantbg commented 5 years ago

Problem with fetching the page in api.php

capture d ecran 2018-12-07 a 14 27 04 capture d ecran 2018-12-07 a 14 27 15
sylvainjule commented 5 years ago

Let me know if the last commit fixes this! It should.

tristantbg commented 5 years ago

Thank you! Works perfectly now.

(I tried to do page($uri) but didn't know you needed to add kirby() before in plugins)

sylvainjule commented 5 years ago

The issue was also with the uri formatting, the panel is now sending a pages/projects+moving-images+the-last-souvenir string, while it must be projects/moving-images/the-last-souvenir to be used as the page() method argument.

(I didn't even try it without kirby() actually, just tried also and indeed it's needed. The shortcut is probably wrapping $kirby->page(), while $kirby isn't defined in plugins).