Thanks, that’s helpful but I don’t think it applies. All contexts have names in the DB table. And I did not skip any x.x.0 upgrades. The base install was 2.6.5, then I upgraded to 2.7.0 recently. There was nothing in between as far as I know.
Here’s my code. It actually works fine
except that the
current context always has no name. I have 5 contexts including the default.
When a visitor is within the “europe” context, their “Europe Home” button is blank. When they switch to any other context, “Europe Home” will work, but then the current region’s home button will become blank. I’m mystified! Any ideas?
<?php
$output = array();
$keys = array('europe','asia','middleeast','americas');
foreach ($keys as $key){
$ctx = $modx->getContext( $key );
if ($ctx) {
$output[$ctx->get('key')] = array(
'key' => $ctx->get('key'),
'name' => $ctx->get('name'),
'http_host' => $ctx->getOption('http_host', null, ''),
'site_url' => $ctx->getOption('site_url', null, ''),
'base_url' => $ctx->getOption('base_url', null, ''),
'site_start' => $ctx->getOption('site_start', null, ''),
);
}
}
return $output;