GetSimple Support Forum
Using Custom Fields with i18N - Printable Version

+- GetSimple Support Forum (http://get-simple.info/forums)
+-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3)
+--- Forum: General Questions and Problems (http://get-simple.info/forums/forumdisplay.php?fid=16)
+--- Thread: Using Custom Fields with i18N (/showthread.php?tid=5120)



Using Custom Fields with i18N - j*z - 2013-08-29

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');
}
?>