Problem in css OJS 3.0.2

Hi @NateWr,

thanks for your advice about the custom CSS. However, as I read before in this thread, that CSS only will affect the front end that the final user (Non-admin or technical) will see?

I’m modifying the code/css of OJS itself, so I understand that tiny CSS file will never be used?

Kind regards, Jose

Hi @Jose_Ares,

Yes, you’re correct. If you want to load CSS code in the backend, you will probably want to create a custom plugin to do that, with the following code:

$request = Application::get()->getRequest();
$templateMgr = TemplateManager::getManager($request);
$templateMgr->addStyleSheet('your-styles', $request->getBaseUrl() . '/' . $this->getPluginPath() . '/path-to-your-styles.css', ['contexts' => 'backend']);

Hi @NateWr, thanks again for your help.

Unfortunately, as far as I know I didn’t have a hook set for the type of work I wanted to do (Add new buttons under specific conditions in Production tab) and also I’m still not proficient enough with a plugin that complex.

My solution was to add the addStyle call with a new CSS stylesheet to the backend, and it worked fine.

However, I created some modals and the CSS I’m using for the tab HTML code is not taken by the modals. Do I have to add CSS code in a different place when using AJAX modals?

Thanks and best regards, Jose

If you want to share your code I’d be happy to take a quick look.