Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Dennis Ploetner

    (@realloc)

    OK … it’s not that hard. 😉

    Insert some code – for example like this –

    <select id="msls_languages">
    <?php if (function_exists ('the_msls')) the_msls (); ?>
    <select>

    in your header where you would like to have the drop-down. In your functions.php insert a function like this

    function my_msls_output_get( $url, $link, $current ) {
        return sprintf(
            '<option value="%s"%s>%s</option>',
            $url,
            ( $current ? ' selected="selected"' : '' ),
            $link
        );
    }
    add_filter( 'msls_output_get', 'my_msls_output_get', 10, 3 );

    Hope this helps.

    Cheers,
    Dennis.

    Thread Starter ngoran.ahoua

    (@ngoranahoua)

    Thank you for your help, the solution works very well. but I do not have flags that appear 🙁 is it possible to display ” name + flag” in this drop-down menu?

    Plugin Author Dennis Ploetner

    (@realloc)

    An image in an option? I’m quite sure that this will not work in all browsers.

    I think you could accomplish this much easier if you would set the output-options of the plugin (please read https://github.com/lloc/Multisite-Language-Switcher/wiki/Settings) and then try to format the generated <ul> and the <li>s by this line of code

    <?php if (function_exists ('the_msls')) the_msls (); ?>

    with CSS.

    Thread Starter ngoran.ahoua

    (@ngoranahoua)

    Again thank you for your help! I will try to implement this solution.
    However I have a problem with the drop down menu: Links do not work. I can not switch between versions. I was able to do so as I do not utlisais menu. You know why?

    below a link :

    website

    Plugin Author Dennis Ploetner

    (@realloc)

    Thanks for the link (BTW: There are images in the generated code of the drop-down. Please have a look at the html-code!).

    Yes, a drop-down like this does nothing. You could make use of a little bit of JavaScript. Maybe something like that:

    http://stackoverflow.com/questions/5150363/onchange-open-url-via-select-jquery

    Thread Starter ngoran.ahoua

    (@ngoranahoua)

    Ok,Thank you for your availability and your help!

    Hi,

    Great plugin you made, really helpful. But i dont manage to get it into the topbar. Ive already copied the <?php if (function_exists ('the_msls')) the_msls (); ?> text in the header.php and it is now displaying but id to doesnt have any links, the links are not working.

    Again: thanks a lot

    Plugin Author Dennis Ploetner

    (@realloc)

    Do you have a link where I can see this?

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Language display in a drop-down menu, and in the header.’ is closed to new replies.