• Resolved drteddy

    (@drteddy)


    Hi!

    In the page mentioned I have some Divi’s code modules in which I have links to internal pages of the site. For the greek version the links are OK, BUT how can I edit the code module to add the &lang=en term, since TranslatePress doesn’t work while Divi’s page builder is activated?

    Here is a screenshot hoping to explain further what I exactly mean
    https://i.paste.pics/80HD3.png

    Thanks in advance

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Dragos

    (@dragosvrejiu)

    Hello,

    I don’t know if I understood correctly what you are trying to achieve.

    The Force language in custom links option from TP Settings might help you.

    This is useful if you want to force custom links without language encoding to keep the currently selected language.

    Best wishes,

    Thread Starter drteddy

    (@drteddy)

    I’ll try to be as clear as possible. If you visit the page mentioned in my previous post (bulevart.gr) and scroll down you’ll see (among others) these images:
    https://paste.pics/80UM8

    If you hover to them you’ll understand that there links. Each one of them is Divi’s Code Module. The link is defined through html in Code Module. I want that link changed according the selected language.

    Let me know if I’ve clarified the matter now…

    Thanks again.

    Best Regards

    Dragos

    (@dragosvrejiu)

    Hello,

    You can try using our Conditional Shortcode Based on Language.

    Check our documentation and let me know if it works for you.

    Best regards,

    Thread Starter drteddy

    (@drteddy)

    I think that’s the solution but I’m really having a hard time to implement it.

    Check out the code below:

    <div class="custom_overlay">
     <img src="https://bulevart.gr/wp-content/uploads/2019/10/fessas_crp.jpg" alt="Image" class="image">
         <a href="https://bulevart.gr/erga/?swoof=1&pa_dimiourgos=giorgos-fessas">
              
            <div class="overlay">
                 
                <div class="text">Γι?ργο? Φ?σσα?</div>
            </div>
        </a>
    </div>

    I want the link (in the a tag) be different depending on active language. On the code above is for greek language. For English I want to add the “&lang-en” in the end.

    Any ideas appreciated.

    Thanks again,

    Best regards

    • This reply was modified 4 years, 9 months ago by drteddy.
    • This reply was modified 4 years, 9 months ago by drteddy.
    • This reply was modified 4 years, 9 months ago by drteddy.
    • This reply was modified 4 years, 9 months ago by drteddy.
    Dragos

    (@dragosvrejiu)

    Hello,

    You could try something like this:

    <div class="custom_overlay">
    
      <img src="/" />
    
           [trp_language language="el_GR"]
    
            //link for Greek language
    
           [/trp_language]
    
           [trp_language language="en_US"]
    
           //link for English language
    
           [/trp_language]
    
            <div class="overlay">
               <div class="text">Γι?ργο? Φ?σσα?</div>
            </div>
        </a>
    </div>

    Let me know how this goes.

    Best regards,

    Thread Starter drteddy

    (@drteddy)

    Yes!!

    You’re a life savior! I’ve busted my head these days.

    Thank you very much!

    Dragos

    (@dragosvrejiu)

    I’m glad that it’s working.

    Best of luck with your project!

    With the best regards,

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Translate Divi’s code module’ is closed to new replies.