This extension for Kirbytext will make it possible to use
(thumb: myimage.png width: 200 height: 100)
in your content files.
Put kirbytext.extended.php
in your site/plugins
folder
Make sure to install the thumb plugin as well: https://github.com/bastianallgeier/kirbycms-extensions/tree/master/plugins/thumb
To make sure the thumbs plugin will work, you must create a thumbs folder in your main folder of your site (next to Kirby's index.php) and make sure that it is writable by PHP.
In your content text files you can now use the new thumb tag:
(thumb: myimage.jpg)
myimage.jpg
must be located in the same content folder as the text file in which you use the tag. But of course you are free to name your files like you want :)
You can pass all parameters, which are also available for the thumb plugin:
(thumb: myimage.jpg width: 200 height: 200 crop: true quality: 100)
Feel free to change the $defaults
array in kirbytext.extended.php
to add the values which fit best to your project.
// customize this:
$defaults = array(
'width' => 200,
'height' => 200,
'crop' => false,
'quality' => 100
);
Those defaults will make it possible to use the thumb tag without specifying all the attributes.