Adlago Posted October 24 Posted October 24 How can I use a theme editor or a hook to change my logo when the language selected by a user is the other one used in my installation? Any ideas I appreciate. Thank you
Adlago Posted Wednesday at 09:42 PM Author Posted Wednesday at 09:42 PM I solved this case for me with 2 hooks. 1 hook - I added this code, before front/global/logo {{if \IPS\Member::loggedIn()->language()->id == 1}} <a href='{setting="base_url"}'> <img class= "logo_en" src= "/4home/logo_en.webp" width="408" height="120" alt="Nophelet consults"> </a> {{endif}} In a second hook, I hide the original logo with this code, after front/global/logo {{if \IPS\Member::loggedIn()->language()->id == 1}} <style> .ipsLogo__image {display: none;} </style> {{endif}} This works fine for me. But when I test the html5 validation I see an error related to this code. Error: CSS: --logo_en: Missing a semicolon before the property name blob. From line 104, column 12; to line 104, column 15 -logo_en: blob:https.... While browsing the source code page I came across this change to the inline style theme variable that was added by beta software (not sure which beta because I created these hooks shortly after this theme) <style id="themeVariables"> :root{ ................... --light__i-mobileFooter--co: hsl(238 99% 24%); --logo_en: blob:https://nophelet.com/79663999-4970-4a94-aea7-23b0574c3804; --dark__i-base-l: 54; .............. } </style> Any idea to remove this error?
Adlago Posted Thursday at 09:26 AM Author Posted Thursday at 09:26 AM Actually, I guessed what happened. Before creating my hooks I tried to create a new editor setting in category image logos(desktop). In default value I set this link with img src etc. Then I found that the logo image in the theme editor can be uploaded, but after saving, this image disappears from the theme editor. I gave up and deleted this new setting and currently there is nothing in the ACP/Themes - theme editor. Today I looked through the database and in the core_theme_editor_history table, I found the added link from me. This is probably a bug - after deleting a custom setting, all information about that setting is not removed in database. I can remove this link from the database, but I'm not sure exactly what part to remove. Please advice.
Marc Posted Thursday at 10:22 AM Posted Thursday at 10:22 AM If you believe you have found a bug, please report it in the bug tracker
Adlago Posted Friday at 09:22 PM Author Posted Friday at 09:22 PM On 11/21/2024 at 12:22 PM, Marc said: If you believe you have found a bug, please report it in the bug tracker I repeated the steps to create a new theme editor setting. The issue this theme is for did not occur while the issue I mentioned still existed. I removed this bad link from the core_themes database table and all html5 validation errors were resolved. I'm not sure which beta this issue occurred in, but it doesn't occur in beta 5, so I won't be creating a bug report. Marc 1
Recommended Posts