I have a select field with a list of countries:
country:
label: Country
type: select
options:
AF: Afghanistan
AL: Albania
DZ: Algeria
...
and when I display the text it displays with the AF from Afghanistan rather than the display text - is there a way to display the display name?
So when I use
<?php
$groupedItems =
$pages->find('content')
->children()
->visible()
->group(function($p){
return $p->country();
});
foreach ($groupedItems as $country => $articles): ?>
<h2><?= $country ?></h2>
<?php endforeach ?>
<?php endif ?>
It would display “Afghanistan” rather than “AF”