Jump to content

slowtravelmorocco

Member
  • Posts

    21
  • Joined

  • Last visited

Posts posted by slowtravelmorocco

  1. Site URL: https://www.slowtravelmorocco.com/

    Hey there,

    I am using 7.1 and have a language switch installed.

    Now I switched up the navigation bar (using a logo now instead of title) and the language switch button is not visible anymore as well as the nav bar shows navigation titles from the other language (using german and english).

    My question is: Can someone fix the disappearance of the switch button and place it somewhere else in the navigation bar / or find another solution on where to place the button so it doesn't get lost each time I am changing the style of the navigation bar? Appreciating your support!

    This is the current code I have installed:

    <style>
        .language {
            position: absolute;
            z-index: 999;
            top: -20px;
            right: 0;
            display: inline-block;
          }
          .language a:first-child {
            border-right: 1px <color=white>
          }
          .language a {
            border: none;
            margin: 0 5px;
            width: 40px;
            height: 26px;
            display: inline-block;
            background-position: center top;
            float: left;
            text-indent: 0;
            color: transparent;
            font-size: 20px;
            <span style="color:white"> Weiße Schrift </span>
          }
          .language [href="/en/home/"] {
            background: none;
            background-size: cover;  
          }
          .language [href="/de/home"] {
            background: none;
            background-size: cover;
            width: 33px
          }


    </style>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
    <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 ){
        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 */
      if (lang == "en") {
        $('a[href="/"]').attr("href", "/en/home/");
      }

      /* 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();
    });

    </script>
    <script>
    /*setup language switcher*/
    $('.header-title-text').prepend('<div class="language"><a href="/de/home" class="lang-en">DE</a><a href="/en/home/" class="lang-es">EN</a></div>');
    </script>

  2. 1 hour ago, Lucia_ said:

    hi @slowtravelmorocco

    thank you for your fast responds. I just deleted the logo and nothing happened. 
    I am using the latest version 7.1 - I have seen the switcher before but somehow after making the minor changes suggested above it disappeared. 

    ok i see. probably some minor issue in the code - the person who wrote the code might can help out here.

    ps: can you help me with the footer? what was your solution for the "imprint" "data security" when customers use your english website version? how did you figure it out? I am also using 7.1. but i can also "link" navigation pages ..so for me both languages show up at the same time..thank you for any suggestions.

  3. 4 minutes ago, Lucia_ said:

    @tuanphan when I remove this code in the header my drop down wont work anymore. 

    <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

    https://www.theginiusway.ch/de/faq -> drop down

    further I cant seem to see why my language Icon at the top right has disappeared. 

    thank you for your help

    Hi Lucia,

    my language icon/switch also disappears whenever I install a logo in the header. I´m not sure if that´s also the source of your issue, but could be.

    Try removing the logo for a second and see if the language icon is back.

    Also a question: Are you using squarespace 7.1 or 7.0 ? I am using 7.1 and having issues figuring out how to put my "data security" and "faqs" in the footer (i can only link those pages and not put them there like in the header navigation). so right now both languages show up at the same time in my footer..what´s the solution to that? (ps: do you speak german as well?)

  4. @bangank36 hey there, I was wondering if you could help again?

    I am facing the issue, that I can only link navigation items into my footer. But I can´t manage to just show the english navigation there when using the english website version or only showing the german navigation links in the footer, when using the german website version. I hope there is a code solution to that issue?

    The following links would need to be included into the footer:

    german urls:

    de/faq-reisen-in-marokko

    de/datenschutz-impressum

     

    english urls:

    en/faq-when-traveling-in-morocco

    en/data-security-imprint

     

    here´s the link again: www.slowtravelmorocco.com

     

    Thank you so much - I also posted a thread in the general forum but havent had any response since weeks..

     

     

  5. On 6/20/2020 at 3:35 PM, bangank36 said:

    Glad it helps

    hi @bangank36 would there be a possibility also to place the language switch on the top right instead of top left? And could we just name the switch "DE | EN" (german/english) and take away the flags? i think a bit more minimalistic design would fit much better on my site and the top left position could interfere with my logo that I will be placing there soon as well... I appreciate your support! 

    Screenshot 2020-07-04 at 10.51.59.png

  6. Hey there,

    I am using 7.1 and my default language is german.

    I want a simple and good looking german/english switch option on the home page (i dont want a cover page etc.).

    I have injected already a code that makes only the default language main navigation visible and hides the english ones - i have done that by giving each folder and page a "/de/.." or "/en/.." URL slag. The code makes the "en" ones invisible. 

    Now i want a code that creates a nice looking language switch somehwere on the top on my website (header etc.).

    Right now it looks like that (see attachment) and i cant even click on either on them..and the switch looks very weird and unprofessional.

    Please send help! I´m a beginner in coding..:)

    Screenshot 2020-06-18 at 17.30.39.png

  7. On 4/8/2020 at 5:10 AM, tuanphan said:
    If you use Personal Plan, use this guide https://beaverhero.com/squarespace-2-languages

    Hey there,

    I have checked out your code injection for business plan and part of it worked well (the part where just the default language is showing in the main navigation and the other language is invisible). 

    The code for the language switch did look very weird though and also I couldn´t click on them. I want "german" as my default and "english" as 2nd option. What exactly do I have to inject as code to show a decent nice language switch on my website - also with flags? The link you shared didnt give me any info for which code to inject for which flag etc..I´m a real beginner when it comes to coding and I just want a decent language switch showing on my website that works..HELP :)

    PS: I have attached a screen shot of how the language switch looks right now (its on the very left upper corner)..it doesnt really look well and as said- i cant click either of them..they seem to be passive..

    Screenshot 2020-06-18 at 17.30.39.png

×
×
  • 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.