resources/views/fact-media.phtml
<?php
declare(strict_types=1);
use Fisharebest\Webtrees\Fact;
/**
* @var Fact $fact
*/
?>
<?php if (preg_match_all('/\n(2 OBJE\b.*(?:\n[^2].*)*)/', $fact->gedcom(), $matches, PREG_SET_ORDER) > 0) : ?>
<div class="wt-fact-media mt-2">
<?php foreach ($matches as $match) : ?>
<?= view('fact-gedcom-fields', ['gedcom' => $match[1], 'parent' => $fact->tag(), 'tree' => $fact->record()->tree()]) ?>
<?php endforeach ?>
</div>
<?php endif ?>