Embedding different video based on language: elementor
-
Hello,
I have seen this question multiple times on this forum but it was never answered in a way that works for me. I want to embed a different video in a page based on what language is chosen. I have tried putting the following code in as a shortcode to the site but it just appears blank. I am using elementor if this makes a difference.[trp_language language=”en_US”]
<iframe width=”560″ height=”315″ src=”https://www.youtube.com/embed/Km9-DiFaxpU” frameborder=”0″ allow=”accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture” allowfullscreen></iframe>
[trp_language language=”fr_FR”]
<iframe width=”560″ height=”315″ src=”https://www.youtube.com/embed/owTeaStAaZw” frameborder=”0″ allow=”accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture” allowfullscreen></iframe>[/trp_language]without the trp_language code the iframes show up normally. Is it just not possible to get different videos to appear based on language selection using your app or am I just doing it wrong?
ThanksThe page I need help with: [log in to see the link]
-
Hello,
The code seems good – but you forgot to add the closing shortcode after the English widget.
[trp_language language=”en_US”]
<iframe width=”560″ height=”315″ src=”https://www.youtube.com/embed/Km9-DiFaxpU” frameborder=”0″ allow=”accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture” allowfullscreen></iframe>
[/trp_language]
[trp_language language=”fr_FR”]
<iframe width=”560″ height=”315″ src=”https://www.youtube.com/embed/owTeaStAaZw” frameborder=”0″ allow=”accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture” allowfullscreen></iframe>
[/trp_language]But, as you use Elementor I think you could use our integration within the plugin to condition the widgets based on language.
You can read more about this here:
https://translatepress.com/docs/translation-shortcode/#elementor-integration.Kind regards,
Hi,
I am having a similar issue with iframe that should show different pdf documents if opened in the english or spanish version.
I don’t have previous experience with coding but I am looking for an easier method that the one I found, duplicating all buttons hiding them respectively in each language. But I prefer to try something different as I need this for several elements in the website
You may see what I mean in the website: https://www.sineria.com/biological-products-inoculants/
Please, I appreciate any help.
I have the same issue. Second video is blank. 🙁
The topic ‘Embedding different video based on language: elementor’ is closed to new replies.