Fork me on GitHub

Xanthia plugin for Dynamenu multilanguage  Bottom

  • Do you need to show a different Dynamenu inside a Xanthia theme depending on the present language? Here is a plugin that will do the job:

    Code

    <?php
    function smarty_function_dynamenu($params, &$smarty)
    {
        // Show a specific dynamic menu block
    $lang = pnUserGetLang();
    if ($lang=="ita") {
        $block = pnBlockGetInfo('XX');
        $block['bid'] = 'XX';
        } else {
        $block = pnBlockGetInfo('YY');
        $block['bid'] = 'YY';
        }
        pnBlockShow('Core', 'dynamenu', $block);
        return;
    }
    ?>


    Replace the XX and YY with the id of the blocks you want to use and ita with the 3 letters of your main language.
    Name it function.dynamenu.php and save inside the plugins directory of the Xanthia module. Put a call like:

    Code

    <!--[dynamenu]-->
    in your master.htm and here you are!
  • That's pretty nifty, Sesto - nice work! (Though as an ego-centric Yank I only speak one language - O.K., maybe a little French!)

    --
    Get PhotoGallery, PayPalCart, Dynamenu, Enhanced Blocks & other mods

    Cape Cod Travel Info...
  • 0 users

This list is based on users active over the last 60 minutes.