template_preprocess custom block type I have a custom block type with two different fields.
What I am trying to accomplish is, to hide the first field if the second is not empty.

That seems like something that could be done in template_preprocess, but where would I put it and what would be my template?

thanks!
you can utilize twig's if/else condition:


Find the twig's template file for your custom block using twig debug mode
use twig's if/else syntax (reference)


{% if field_NAME_OF_YOUR_SECOND_FIELD.0 == false %}
    {{ field_NAME_OF_YOUR_FIRST_FIELD.0 }}
{% endif %}


check this for extracting the values of different fields