Dark/Light theme in the backend - configurable?
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Dark/Light theme in the backend - configurable?
How does the dark/light theme in the Aimeos BE work? I always get the dark theme, even at noon. Is there a way to configure, which theme I'd prefer to have (which would be "light")? Or is there some kind of automatic dependency (browser, OS) working its magic?
Re: Dark/Light theme in the backend - configurable?
in JqadmController.php there is a line that checks the dark/line setting against a set cookie:
That cookie "gets lost" as soon as the browser gets closed. It is only created again, when the toggle is clicked. (TYPO3 11, php8.1, aimeos 22.10). But – strangely enough! – phpbb cookies get set. Why is that? (I assume phpbb is the forum software you use for your help section. But why does the aimeos be in a TYPO3 installation set cookies that are irrelevant? Isn't that a GSPR problem?)
It would be great to have an option in the "settings" area that allows the admin to set a default ("light", "dark", and maybe even "auto").
Code: Select all
$view->assign('theme', ($_COOKIE['aimeos_backend_theme'] ?? null) == 'dark' ? 'dark' : 'light');
It would be great to have an option in the "settings" area that allows the admin to set a default ("light", "dark", and maybe even "auto").
Re: Dark/Light theme in the backend - configurable?
If you have configured your browser to prefer dark mode, then the dark mode is used by default:
https://github.com/aimeos/ai-admin-jqad ... js#L10-L11
There's no "admin profile" where you can change settings for your account globally and therefore, the cookie solution was chosen. It would be also possible to use the storage of the browser which can be also session based or permanent.
The set cookie seems to be a session cookie that is removed if you close the browser because no expiry is set. If you can create a PR which adds an expiry time in the future, we are happy to merge it:
https://stackoverflow.com/questions/131 ... xpire-time
PHPBB cookies have a short lifetime but are not session based. They are necessary for the functionality of PHPBB and therefore the GDPR doesn't apply (it's only for tracking cookies).
https://github.com/aimeos/ai-admin-jqad ... js#L10-L11
There's no "admin profile" where you can change settings for your account globally and therefore, the cookie solution was chosen. It would be also possible to use the storage of the browser which can be also session based or permanent.
The set cookie seems to be a session cookie that is removed if you close the browser because no expiry is set. If you can create a PR which adds an expiry time in the future, we are happy to merge it:
https://stackoverflow.com/questions/131 ... xpire-time
PHPBB cookies have a short lifetime but are not session based. They are necessary for the functionality of PHPBB and therefore the GDPR doesn't apply (it's only for tracking cookies).
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Dark/Light theme in the backend - configurable?
Thank you! I forgot that I have my browser set to use the dark theme by default.
(It is a pity that there is always a flash... the light theme can be seen for a short moment before the dark theme is active whenever one navigates to another page...)
However: As for the PHPBB cookies: why are there even PHPBB cookies in aimeos? That is what I do not understand! Just to make it clear: Those cookies are placed when I open my TYPO3/aimeos instance, on my domain – I am NOT talking about the forum! On my site there is not PHPBB...
(It is a pity that there is always a flash... the light theme can be seen for a short moment before the dark theme is active whenever one navigates to another page...)
However: As for the PHPBB cookies: why are there even PHPBB cookies in aimeos? That is what I do not understand! Just to make it clear: Those cookies are placed when I open my TYPO3/aimeos instance, on my domain – I am NOT talking about the forum! On my site there is not PHPBB...
Re: Dark/Light theme in the backend - configurable?
This is due to the JS code that runs after the browser painted the elements with the light styling ...
The PHPBB cookies are from the aimeos.org web site. There can't be any PHPBB cookies at your own domain if you haven't installed PHPBB there too. Maybe the browser sends all cookies for aimeos.org due to the version check that occurs when you open the admin backend (check if there's a newer version available for security reasons).rowild wrote: ↑08 Mar 2023, 11:53 However: As for the PHPBB cookies: why are there even PHPBB cookies in aimeos? That is what I do not understand! Just to make it clear: Those cookies are placed when I open my TYPO3/aimeos instance, on my domain – I am NOT talking about the forum! On my site there is not PHPBB...
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Dark/Light theme in the backend - configurable?
To get rid of the flash, the decision which theme should load could already be met where the css files are loaded (instead of setting a var in the body tag).
The PHPBB cookies are indeed only set, when I open the forum. It is weird that they are shown on my domain. No other cookies (like Gmail, Google Maps, etc) are shown under the application tab. Why is that? (Just updated to the latest packages via composer...)
The PHPBB cookies are indeed only set, when I open the forum. It is weird that they are shown on my domain. No other cookies (like Gmail, Google Maps, etc) are shown under the application tab. Why is that? (Just updated to the latest packages via composer...)
Re: Dark/Light theme in the backend - configurable?
That would require loading the CSS after the code JS decided about the theme and is not really preferable.
Don't know.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star