Added option 'twig' to form field to evaluate label using twig. - #474
Added option 'twig' to form field to evaluate label using twig.#474NicoHood wants to merge 3 commits into
Conversation
mahagr
left a comment
There was a problem hiding this comment.
Otherwise I do not object, but both form.markdown and form.twig parameters now doing two things which are not related to each other. Also what if I want description to be markdown?
These parameters should really be all renamed with some deprecation message for people who still use the old ones.
IMHO the best approach would be to pass an array:
my_field:
label:
text: My Label
markdown: true
twig: truewhile still allowing the value to have a string for a shortcut.
@rhukster What do you think?
|
This approach is a good and granular idea, however it will get very messy to implement. I think the core issue currently is the naming conflict In my PRs this means:
I think you are right: they should be named the same. What about "renaming"
The name my_field:
label: '**label** {{ page.title }}'
default: 'also **markdown**'
markdown: true
twig: true |
|
Again, i'll take a look at this after the next release. |
Example:
Combined with getgrav/grav#3139 this becomes very powerful, as you can use
theme_var('doc_route')to load url settings (and other stuff) here dynamically.