Jump to content

Kairike

Circle Member
  • Posts

    13
  • Joined

  • Last visited

Kairike's Achievements

  1. 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>
  2. 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>
  3. 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>
  4. That's great, Ziggy! Thank you. Exactly what needed.
  5. 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 😊
  6. 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.
  7. 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
  8. Oh, great! That worked! I actually tried to invent some code and insert it in the blog page settings before asking for help here, but I must've written something wrong. ☺️ Thank you so much!
  9. 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.
  10. Shouldn't his item #item-649c1a7b6f187d00ad5474a0 only affect that one blog post because every post has a different #item? I would like all the posts within this blog #collection-649c1a7b6f187d00ad54749f be narrow. Currently not even that one post changes the width.
  11. Strange, but it has no effect on the page. Copied the exact code. Even tried to make the % smaller.
  12. 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!
  13. 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
Γ—
Γ—
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.