Jump to content

Recommended Posts

Posted

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

  • 4 weeks later...
Posted

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?

Posted

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.

logo_en.thumb.png.599d693937f54d340be211bd9f20107f.png
I can remove this link from the database, but I'm not sure exactly what part to remove.
Please advice.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...