How to hide multiple fields from display in Drupal 8 using the Twig "without" filter.
I'm just posting this here in case anyone is searching for it.
Here is how to remove multiple fields from display in a template file using Twig in Drupal 8:
{{ content|without('field_yourfield', 'field_yourfield2') }}
In this example the without filter is taking two values to exclude them from display. They can be rendered on their own later on like this:
{{ content.field_yourfield }}
{{ content.field_yourfield2 }}
In Drupal 7 we would have done something like this:
<?php
hide($content['field_yourfield']);
hide($content['field_yourfield2']);
print render($content);
?>
And later:
<?php print render ($content['field_yourfield']); ?>
<?php print render ($content['field_yourfield2']); ?>