-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added option 'twig' to form field to evaluate label using twig. #474
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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: true
while 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.