With my module, I added to the site settings a new field of the type Asset that works as an image or thumbnail that represents the site. I am able to get the option like this:
$site_settings = $site->getServiceLocator()->get('Omeka\Settings\Site'); echo ($site_settings->get('site_image')); // This would print the chosen asset ID
The problem is that, since I’m using
getServiceLocator, the settings that I get are always the ones corresponding to the current site (where the view happens or the default site, if I try to access them for an admin view), even if I use another site, which I get with:
$sites = $this->api->search('sites')->getContent(); // Array of Omeka\Api\Representation\SiteRepresentation
I haven’t found any way to get Site Settings with the API. Is there any way to get the settings from an arbitrary site, without using SQL?
$connection = $serviceLocator->get('Omeka\Connection'); // I'd like to avoid this
Sorry for the odd question. The result will be a site-grid block