jaunevermeer Posted December 17, 2020 Share Posted December 17, 2020 Site URL: https://www.staciedollx.com/ Hey there, i'm working for someone wensite and i was able first to redirect my header logo to my english section, but since i have also a french section i don't know how to redirect only to the french section. Here is the code i use for the english version. <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <script>$(document).ready(function () { $(".header-title-logo a[href]").attr("href", "https://www.staciedollx.com/en/home"); }); </script> Is there a way that my website recognize i'm on my french version, so it would redirect to my french page ? Also i have a fake cover page (version 7.1) as my home page. Thanks Link to comment
creedon Posted December 17, 2020 Share Posted December 17, 2020 Please post your site-wide password so we can take a look at your issue. Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects. Link to comment
jaunevermeer Posted December 17, 2020 Author Share Posted December 17, 2020 Staciedoll is the password Link to comment
creedon Posted December 17, 2020 Share Posted December 17, 2020 That password doesn't work. Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects. Link to comment
jaunevermeer Posted December 18, 2020 Author Share Posted December 18, 2020 Changed it : pass111 Link to comment
creedon Posted December 18, 2020 Share Posted December 18, 2020 Replace your script, store somewhere for safe keeping or comment out, then add the following. <script> $( document ).ready ( function ( ) { // change site logo link to home pages of multi-language site let languageHomeUrlSlug = { '/en' : '/home', '/es' : '/moi' } // do not change anything below, there be the borg here let languageUrlSlug = location.pathname.substring ( 0, 3 ); if ( ! Object.keys ( languageHomeUrlSlug ).includes ( languageUrlSlug ) ) return; let href = languageUrlSlug + languageHomeUrlSlug [ languageUrlSlug ]; $( '.header-title-logo a, .header-mobile-logo a' ).attr ( 'href', href ); } ); </script> Let us know how it goes. Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects. Link to comment
jaunevermeer Posted December 18, 2020 Author Share Posted December 18, 2020 Wich one should i change, the header or footer ? Thanks ! Link to comment
jaunevermeer Posted December 18, 2020 Author Share Posted December 18, 2020 It works but now my menu is all there, english and french ! Anyway i could have my french menu only when i select the french website ? Thanks ! Link to comment
creedon Posted December 18, 2020 Share Posted December 18, 2020 7 hours ago, jaunevermeer said: It works but now my menu is all there, english and french ! Anyway i could have my french menu only when i select the french website ? My code doesn't do anything to the menus. I saw no effect on the menus when I ran it. I suggest removing my code temporarily to see if that helps the issue. It sounds like you changed the code in PIED DE PAGE which broke the code that was controlling which language version of the menu is seen. Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects. Link to comment
creedon Posted December 18, 2020 Share Posted December 18, 2020 7 hours ago, jaunevermeer said: Wich one should i change, the header or footer ? Thanks ! Replace the code you posted... On 12/16/2020 at 5:36 PM, jaunevermeer said: <script>$(document).ready(function () { $(".header-title-logo a[href]").attr("href", "https://www.staciedollx.com/en/home"); }); </script> ...in EN-TETE. Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects. Link to comment
jaunevermeer Posted December 20, 2020 Author Share Posted December 20, 2020 Thanks ! It work quite well ! 😄 Link to comment
jaunevermeer Posted December 23, 2020 Author Share Posted December 23, 2020 Hi there again, I have a bug on the mobile version, when i click on the logo to go home @creedon, do i have to change the code for mobile version? Link to comment
creedon Posted December 23, 2020 Share Posted December 23, 2020 I updated my previous code post to cover mobile. Let us know how it goes. Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects. Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.