Changing the CSS of Omeka global pages


I would like to change the layout and css of omeka global pages.
I have create a module that maps those global pages to my_theme like this. It works.

    'view_manager' => [
        'template_path_stack' => [
            dirname(__DIR__) . '/view',
        'template_map' => [
           'omeka/index/index' => __DIR__ . '/../../../themes/my_theme/view/omeka/site/index.phtml',
           'omeka/search/results' => __DIR__ . '/../../../themes/my_theme/view/omeka/search/results.phtml',

But I am unable to discover how to change the css of those pages.

I see that when the global index loads, the browser downloads /application/asset/css/style.css but I can’t see how to change that.

Am I missing something obvious? How do you do it?


The CSS loads are going to be the layout view, so I think you’d have to override that as well to change them.


Thanks. I’ve copied layout.phtml and added it like this

'template_map' => [
  'layout/layout' => __DIR__ . '/../../../themes/my_theme/view/layout/layout.phtml',
  'omeka/index/index' => __DIR__ . '/../../../themes/my_theme/view/omeka/site/index.phtml',
  'omeka/search/results' => __DIR__ . '/../../../themes/my_theme/view/omeka/search/results.phtml',
  'common/site-list-entry' => __DIR__ . '/../../../themes/my_theme/view/common/site-list-entry.phtml',

The global index page is throwing this error.

Fatal error: Uncaught Error: Call to a member function getSettingsKey() on null in
./omeka/omeka-s/application/src/Service/ViewHelper/ThemeSettingFactory.php:24Stack trace: #0
Omeka\Service\ViewHelper\ThemeSettingFactory->__invoke() #1
Laminas\ServiceManager\ServiceManager->doCreate() #2
Laminas\ServiceManager\ServiceManager->get() #3
Laminas\ServiceManager\AbstractPluginManager->get() #4
Laminas\View\Renderer\PhpRenderer->plugin() #5
./omeka/omeka-s/themes/my_theme/view/layout/ in
./omeka/omeka-s/application/src/Service/ViewHelper/ThemeSettingFactory.php on line 24

I can’t for the life of me work out where to fix this. So I started commenting out everything referenced to $this->themeSetting() in the index.phtml file, but that quickly got out of control.

I’m stuck. :cry:

Your problem is, probably, that your layout and/or index page view is using calls to get site and/or theme settings: both of those things only work in the context of a “current site,” and there is no current site on the global pages.