Jump to content

MoChilla

Member
  • Posts

    3
  • Joined

  • Last visited

MoChilla's Achievements

Level 1

Level 1 (1/20)

0

Reputation

  1. Dear circle memnbers, web developers and squarespace users - here's a challenge for you. I tried to find some existing discussion but couldn't. I created a new website and connected it with an existing domain http://www.spendenhilfsdienst.ch. After the connection succeeded I also applied for an SSL certification to get the https://www.spendenhilfsdienst.ch . I've used customized Java Script Code to offer the website in two languages (german & french) by connect each german page with the french page by clicking on DE | FR respecitvely. I've also used the following code, which I suspect to be part of the problem: * // Redirect to the default language homepage window.location.href = '/de/startseite/'; * Although the website works in both languages when accessing directly. It is a mess on google. After I've registered the domain-property spendenhilfsdienst.ch on google search console I uploaded the sitemap https://www.spendenhilfsdienst.ch/sitemap.xml and it said it was successful but a lot of them are not indexed. I removed all the old sitelinks and asked for every new site link to be indexed. What I don't get is that if you search with 'spendenhilfsdienst site:spendenhilfsdienst.ch' it shows http:// -entries with the new logo and https:// -entries with the old logo like here: Also I am missing the structured listing like below (with all the correct sitelinks): What am I missing? I don't understand the logic of this. Can anybody please help me? Thanks!
  2. Hi Creedon I am facing a similar problem like HP920. the language switcher is oddly placed over the burger menu in the mobile verion or when I shrink the desktop window. I've used the following code for the language switcher in the footer of the code injection: --------------------------------------------------------------------------------------------------------------------- <script> $(function() { /* SETUP MULTI-LANGUAGE */ var defaultLanguage = 'de'; var lang = location.pathname.split("/")[1]; var defaultClass = 'lang-' + defaultLanguage + ''; var itemParent = "nav [class*='collection'],nav [class*='folder'],nav [class*='index'],nav [class*='group']"; if (lang == "" || lang.length > 2) { 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 */ if (lang == "de") { $('a[href="/"]').attr("href", "/de/startseite/"); } else if (lang == "fr") { $('a[href="/"]').attr("href", "/fr/page-daccueil/"); } /* ADD EXCLUSION NAV ITEMS */ $('.exclude-me,.exclude-me a').addClass('exclude'); $('.sqs-svg-icon--list a,.SocialLinks-link,.header-menu-controls-control').addClass('exclude'); /* REMOVE OTHER LANGUAGES AND KEEP EXCLUDED ITEMS */ $('.multilanguage:not(".lang-' + lang + ',.exclude")').remove(); /* SETUP LANGUAGE SWITCHER */ var currentUrl = location.pathname; var switcherUrl = currentUrl.replace('/' + lang + '/', '/' + (lang === 'de' ? 'fr' : 'de') + '/'); switch (currentUrl) { case '/de/startseite': switcherUrl = switcherUrl.replace('/startseite', '/page-daccueil'); break; case '/fr/page-daccueil/': switcherUrl = switcherUrl.replace('/page-daccueil', '/startseite'); break; default: var germanPages = ['startseite', 'ueber-uns', 'dienstleistungen', 'team', 'referenzen', 'karriere', 'kontakt', 'stellenportal', 'impressum', 'datenschutzerklaerung' ]; var frenchPages = ['page-daccueil', 'a-propos', 'services', 'lequipe', 'references', 'carriere', 'contact', 'portail-de-lemploi', 'impression', 'declaration-de-protection-des-donnees']; var germanIndex = germanPages.indexOf(currentUrl.split('/')[2]); var frenchIndex = frenchPages.indexOf(currentUrl.split('/')[2]); if (germanIndex > -1) { switcherUrl = switcherUrl.replace('/' + germanPages[germanIndex], '/' + frenchPages[germanIndex]); } else if (frenchIndex > -1) { switcherUrl = switcherUrl.replace('/' + frenchPages[frenchIndex], '/' + germanPages[frenchIndex]); } break; } /* Language-Initials DE | FR */ $('body').prepend('<div class="language"><a href="' + switcherUrl + '" class="lang-de">DE</a> <a href="' + switcherUrl + '" class="lang-fr">FR</a></div>'); }); </script> CSS: /*SETUP STYLE LANGUAGE SWITCHER*/ .language { font-size: 16px; position: fixed; top: 39px; right: 20px; z-index: 99999; } /* Entfernen Sie den Trennstrich "|" nach "FR" */ .lang-fr:not(:last-child)::after { content: none; } /* Ändern Sie die Schriftfarbe für "DE" und "FR" */ .lang-de, .lang-fr { color: #3255A4; /* Ersetzen Sie #3255A4 durch die gewünschte Farbe */ } /* Ändern Sie die Schriftfarbe beim Hover für "DE" und "FR" */ .lang-de:hover, .lang-fr:hover { opacity: 0.8; } --------------------------------------------------------------------------------------------------------------------- Is there a possibility to integrate the language switcher in the burger menu? Or do you know a better solution? Many thanks for your help! Cheers!
×
×
  • 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.