1.) Can you please explain, why the hook changes from the code in #06 to #07?
2.) I tested the final code in K3, but I cannot see any difference in the rendered html code of a page, if I change the position in the toggle field. The html code has no change. What does this field do if the content field with the original placeholder is rendered by kirbytext()?
The change is to also make it possible to define options in the config.php file (globally) instead of in the blueprint alone. The global defined options will be merged with the ones defined in the current field’s blueprint.
I haven’t tested this tbh, but as I read the code the placeholders (both defined globally and in the current field blueprint) should get replaced upon each {field}->kirbytext() call (when they are toggled “on”).
This is some text with a {{ inline.placeholder }} bla bla
it shouldn’t contain block level elements.
But you can also have block level replacements
Replacement for `{{ something }}"
# A headline
Some text bla bla
(image: someimage.jpg)
In text:
Some text bla bla
{{ something }}
Some more text
In that case, the replacement should be parsed with Kirbytext, which will happen if you set the block toggle to true. Of course, this placeholder shouldn’t be used inside a paragraph.
My testing of the two hooks had shown me no difference. Therefore I had not understood the two code variants without a corresponding explanation of what the code change does.