I want to use the IMGIX service which you also recommend, as we have a lot of heavy images on our site. I can not find any documentation on implementing it with kirby, and i would think others would also like to know how this can be achieved in a dynamic way. Or better yet let us in on how Kirby uses it?
I would be very grateful if you could help me with this:)
I changed the plugin from Kirby to the our URL and the URL from IMGIX, unfortunately it throws the wrong URL back: https://jungfeldt.imgix.net/content/home/02.jpg" when it should be https://jungfeldt.imgix.net/home/02.jpg
Can you please explain this to me? I’m learning by doing here:)
And one more thing: Please help to improve code readability by wrapping code blocks within three backticks at the beginning and the end of a block on a separate line. I have corrected your code above. To see how it works, click on the pencil icon of your post. Thank you.
The search value here is an array ((array(url(), 'http://jungfeldt.de/assets/images/')), so that you cover images in the content folders and in the assets folder. If any of these search values is found in the haystack ($url), it is replace with an empty string.
Why you need to get rid of the “content” bit I don’t really understand … If I look at the urls at https://getkirby.com, they look like this:
Hello,
I changed the source details in IMGIX to just http://jungfeldt.de/ and now the link is correct but also adds the image source after the img src tag, so the image is unable to display. Do you have any suggestions for further improvements? Also what is the best url path to use as the source for IMGIX on kirby?
<img src="<img src=https://jungfeldt.imgix.net/content/home/01.jpg?" alt="Invitation card with embossment for the Korean crafts and design exhibition, Korea Now! in Bavarian National Museum">
Also: I’m doing all the testing on a local version of the site… should this have any implications?
Thank you! again! It works!! and i can hardly believe it. I will collect all the files and setup so that if someone else wonders about the same thing they can use it to.
Set the base URL to your root domain f.ex.: http://example.com and deploy. You can now test to see if your images are available by entering the new url from IMGIX and adding the path to your images. (f.ex.: https://example.imgix.net/content/home/01.jpg)
If that works your ready to go the next step.
Next you need to set up the plugin from kirby (preumably written by Herrn Allgeier) named imgix.php in a folder named imgix under plugins. (path: plugins/imgix/imgix.php)
How this exactly works is best explained by Texnixe or someone at the same level. But of importance to most is the need to change the link 'http://example.com/' to the same base URL as you provided as the source on IMGIX. The last thing you must change is the url 'https://example.imgix.net/' to the one IMGIX provides you. Then the plugin is finished.
Now you can call your images using the following code:
Hey guys,
first of all, thanks for the walktrough.
I’m going trough the same steps here, but when loading the page, the template prints a warning like this instead of the url:
Warning: http_build_query(): Parameter 1 expected to be Array or Object. Incorrect value given in /home/felipenap/new.aparelho.tv/aparelhov3/site/plugins/imgix/imgix.php on line 7
http://aparelho-test.imgix.net/content/1-overview/6-defei-to/def1.jpg?
any ideas on what could be wrong?
I’ve copied and pasted the code from the imgix plugin, so this is bothering me.