Skip to content
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

Possibility to access enclosing element in text filter? #71

Open
SimmeNilsson opened this issue Mar 3, 2020 · 2 comments
Open

Possibility to access enclosing element in text filter? #71

SimmeNilsson opened this issue Mar 3, 2020 · 2 comments

Comments

@SimmeNilsson
Copy link

Basically I want the same behavior of the "| default: " filter but I have the need to make the text italics when it should display "Missing".
Still want HTML escape and so on though. Would it be possible to access the enclosing element to attach a class or a style to it?

@SimmeNilsson SimmeNilsson changed the title Possibility to access parent element in text filter? Possibility to access enclosing element in text filter? Mar 3, 2020
@mbest
Copy link
Owner

mbest commented Mar 13, 2020

Perhaps it could be built in, but you can always pass the element to the filter: text: field | filter:$element

@SimmeNilsson
Copy link
Author

Thank you!
I was not aware of that opportunity.
It works, but not having to pass it in for every use would have been nice... :)
text: field | missing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants