Is there some Kirby solution for this problem?
Thanks
Is there some Kirby solution for this problem?
Thanks
What do you need exactly? I canβt really tell from the title alone.
Guess to achieve that youβd have to insert non-breaking spaces after every single letter word. As far as I can see, there is no method in Kirby that does that. But you could create a custom field method.
Yes thats my problem, thanks for clarification
Can you share some links where I can find more help with this?
Thanks a lot!
Here is my first try, maybe useful for someone.
I need test it within some Kirby tags.
Kirby::plugin('plugin/name', [
'fieldMethods' => [
'widows' => function ($field) {
$s = explode(' ', $field->value);
foreach ($s as $i => $j) {
if ((strlen($j) == 1 || is_numeric($j)) && !ctype_punct($j)) {
$s[$i] = $j . ' ';
} else {
if ($i < count($s) - 1) {
$s[$i] = $j . ' ';
} else {
$s[$i] = $j . '';
}
}
}
return implode('', $s);
}
]
]);