Okay
  Public Ticket #4100970
WPML translate with One page scroll
Open

Comments

  •  5
    Filip started the conversation

    Hi,

    I'm building a new website for a customer. The homepage uses full-page rows with anchor IDs, allowing users to scroll between sections using the menu. In the default language, this works perfectly. For example:
    https://www.mpro-machines.com/#home

    However, when I switch to another language, such as German, the anchor links no longer work:
    https://www.mpro-machines.com/de/#home

    I also have a question regarding translating the row IDs. I found this article:
    https://wpml.org/documentation/support/language-configuration-files/translate-custom-shortcodes-with-wpml/#translate-id-based-shortcodes

    But I'm not sure how to create the correct Custom XML to make this work.

    Could you please advise?

    Best regards,
    Filip Beunens

  •   Tahir replied privately
  •   Filip replied privately
  •  9,308
    Tahir replied

    Hey Again,

    You will have to use the Wordpress Editor to translate the page and change the anchors per language: https://www.mpro-machines.com/wp-admin/post.php?action=edit&post_type=page&post=481&referer=ate&back=true&lang=fr&admin_bar=1 

    Best,

     


    ThemeNectar Support Team 

  •  5
    Filip replied

    Hi Tahir,

    the translation is not the big issue, I found the XML to be added in WPML Custom XML

    <wpml-config>
      <shortcodes>
        <shortcode>
          <tag>vc_row</tag>
          <attributes>
            <attribute>id</attribute>
          </attributes>
        </shortcode>
      </shortcodes>
    </wpml-config>

    but when I use them in the menu of a language other than the main language the link is not working anymore see https://www.mpro-machines.com/fr/#occasion

    When I switch to language name added as a parameter (https://www.mpro-machines.com?lang=fr-Fr) in WPML it's not working either. 

  •  9,308
    Tahir replied

    Thanks for the details.

    This should help: https://wpml.org/documentation/getting-started-guide/translating-menus/ .

    You will need to duplicate the menu as translating Custom Links via WPML string translation does not work 100%. 

    Best 


    ThemeNectar Support Team 

  •  5
    Filip replied

    I followed everything in the link, my menu is translated correct, the links are also correct, the row id's are also in place but the menu is not responding and scrolling to the anchor.... :-(

    even 1.5 hour chat with WPML but still no solution...

  •  5
    Filip replied

    Hi,

    I found the issue. When a page is translated using WPML, the Salient theme options are not carried over to the translated version — particularly the “Add Row Anchors to URL” setting.

    If we edit the translated page directly using the WP editor (ignoring the warning), and manually enable that option, the problem is resolved.

    Very simple — and honestly a bit silly of me to have missed it.

    Best regards,

    Filip