Kairike
Circle Member-
Posts
16 -
Joined
-
Last visited
Kairike's Achievements
-
Beyondspace reacted to a post in a topic: Geoplugin redirection
-
Ah, great, thank you! I wouldn't have figured it out myself. Maybe that is why the example I found to write my code writes the location.href without HTTP or HTTPS (see below) but I tried that too, didn't work for me. 24β¬ a year is not too bad if that would guarantee that it works. Alternatives like Geo Targetly are way more expensive. <script> if(geoplugin_countryCode() != 'US'){ if(geoplugin_countryCode() == 'CA'){ location.href = "//www.domain.ca"; }else{ location.href = "//www.domain.com"; } } </script>
-
Kairike reacted to a post in a topic: Geoplugin redirection
-
Beyondspace reacted to a post in a topic: Geoplugin redirection
-
Hello, Is it possible to redirect Squarespace pages with the following code? I can't seem to get it to work. I have tried entering the code in the page header section. I'm trying to redirect to a language specific page within the same site, not a separate site/domain. Thank you! K. <script language="JavaScript" src="http://www.geoplugin.net/javascript.gp" type="text/javascript"></script> <script> if(geoplugin_countryCode() != 'EE'){ if(geoplugin_countryCode() == 'GB'){ location.href = "https://www.wizardscreeklabradors.com/en/home/"; }else{ location.href = "https://www.wizardscreeklabradors.com/en/home/"; } } </script>
-
Hi, I know Squarespace can be made multilingual with Weglot, and Weglot uses browser language based redirection. Also, there is the Geo Targetly app that offers geo redirection based on IP address. I have used a workaround method with some code to translate some of my clients' Squarespace websites. This requires duplicate pages for each language and uses code to display the correct ones in the navigation based on the language selection. The advantage of this method is that it's free (no app subscription which can be quite high compared to Squarespace's own plan). Is it possible to enhance this code to allow automatic redirection based on visitor's browser language or IP address? Below is the code I've used for the website: https://www.wizardscreeklabradors.com/ I would appreciate it a lot if anybody figured out how to add automatic redirection to it. π Thank you in advance! K. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> <script> $(function() { /* SETUP MULTI-LANGUAGE */ var defaultLanguage = 'et'; var lang = location.pathname.split("/")[1]; var defaultClass = 'lang-'+defaultLanguage+''; var itemParent = "nav [class*='collection'],nav [class*='folder'],nav [class*='index'],nav [class*='group'],nav [class*='external']"; if (lang == "" || lang.length > 2 ){ var lang = defaultLanguage; } /* ADD LANGUAGE CLASSES */ $('a[href="/"]').addClass('lang-'+defaultLanguage+'').parents(itemParent).addClass('lang-'+defaultLanguage+''); $('nav a:link:not([href^="http://"]):not([href^="https://"])').each(function () { var langType = $(this).attr('href').split("/")[1]; var multiLanguageClass = 'multilanguage lang-' + langType + ''; if (undefined !== langType && langType.length <= 2) $(this).addClass(multiLanguageClass).parents(itemParent).addClass(multiLanguageClass); }); $('nav button').each(function () { var langTypeFolder = $(this).attr('data-controller-folder-toggle').split("/")[0]; var multiLanguageClass = 'multilanguage lang-' + langTypeFolder + ''; if (undefined !== langTypeFolder && langTypeFolder.length <= 2) $(this).addClass(multiLanguageClass); }); /* HOMEPAGE-LOGO LINKS TO PROPER LANGUAGE HOMEPAGE AND CORRECT FOOTER IS DISPLAYED */ if (lang == "et") { $('a[href="/"]').attr("href", "/et/avaleht/"); $('[data-section-id="652bc519a3596101f8999ce2"]').hide(); } if (lang == "en") { $('a[href="/"]').attr("href", "/en/home/"); $('[data-section-id="6499f88a46606b4c4f9a1223"]').hide(); } /* ADD EXCLUSION NAV ITEMS */ $('.exclude-me,.exclude-me a').addClass('exclude'); $('.sqs-svg-icon--list a,.SocialLinks-link').addClass('exclude'); /* REMOVE OTHER LANGUAGES AND KEEP EXCLUDED ITEMS */ $('.multilanguage:not(".lang-'+lang+',.exclude")').remove(); /* SETUP LANGUAGE SWITCHER */ $('body').prepend('<div class="language"><a href="/et/avaleht/" class="lang-et">Est</a> | <a href="/en/home/" class="lang-en">Eng</a></div>'); /* UPDATE CTA BUTTON */ if (lang == "en") { $('.header-actions-action--cta a, .header-menu-cta a').text('Contact us').attr('href', 'https://www.wizardscreeklabradors.com/en/contact'); } }); </script>
-
Ziggy reacted to a post in a topic: Wider navigation than site content
-
That's great, Ziggy! Thank you. Exactly what needed.
-
I have set the site width to 1200px now, with site margin 6 vw. I have set the navigation to full. I can now see the difference. However, the navigation still has quite a lot of space both sides (left and right). https://guava-horse-w3e5.squarespace.com/ Password: autobahn Yes, there is some CSS code added but it shouldn't affect the site width/margin. At least I hope so π
-
Thank you, Ziggy, but whether it's "full" on "inset" does not change a thing. I have recently noticed it that the "full" / "inset" options in different blocks don't seem to work. Below are the screenshots from my site. I can also set the page width (max) to px instead of vw. For example, 1280px. It's the same, the "full" / "inset" options don't change anything.
-
Hello, How do you make the navigation bar wider than the site content? Currently, on Squarespace, it aligns with the content, so whatever site margin you enter, the navigation is the same width. Take a look at https://modera.com/ for example (not a Squarespace website). KF
-
Kairike reacted to a post in a topic: Change blog post content width in only one blog (while having several blogs on the site)
-
Ziggy reacted to a post in a topic: Change blog post content width in only one blog (while having several blogs on the site)
-
I thought so too and tried it, but it changed all the other blogs (their posts) on the website as well. I'm using blogs also here, for example: https://lobster-oriole-j222.squarespace.com/et/labradorid/emased Or here: https://lobster-oriole-j222.squarespace.com/et/pesakonnad/varasemad All these posts shrink to narrow as well if I touch the first blog.
-
Blog page: https://lobster-oriole-j222.squarespace.com/et/blogi Password: wizards What I want narrower, are the actual blog posts within this blog, not the blog summary page above. Post page: https://lobster-oriole-j222.squarespace.com/et/blogi/nds-fci-naitused-luunjas I'm using blog layout also in other sections of the website, and those need to be medium width. It's just the news blog where the posts could be narrow instead. Thank you!
-
Hello, I have several blogs on one of the Squarespace sites I'm creating. If I change the blog post content width in one of the blogs, it applies to all. How could I have the blog posts' content width set to narrow in one of the blogs, while the other blogs' posts are medium width? Thank you in advance! π KF