Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using Custom Fields with i18N
#1
I've got a site where I want a custom form embedded in English for the English page (using i18N) and German for the German page.

I've tried using Custom Fields to specify an HTML file to embed (either English or German depending on the page). I couldn't get this to work with this plugin.

I'm thinking perhaps I can have a PHP if/else statement that will insert the correct component based on the language indicated in the URL. My knowledge of PHP is rather weak so I don't know how I'd go about constructing it. Maybe something like this? Using "_en" to indicate the English version. And the "else" would be the German version (the default language).

<?php $url = 'http://www.my-clients-domain.com';

if (!strpos($url,'_en')) {
echo 'get_component('iframe1')';
} else {
echo 'get_component('iframe2');
}
?>
Reply




Users browsing this thread: 1 Guest(s)