Zikula: A Flexible Open Source Content Management System
home | forum | contact us

Dizkus

Bottom
Xanthia plugin for Dynamenu multilanguage
  • Posted: 09.02.2005, 00:25
     
    eolica
    rank:
    Helper Helper
    registered:
     March 2003
    Status:
    offline
    last visit:
    09.06.06
    Posts:
    104
    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!

    --
    Sesto Avolio
  • Posted: 26.02.2005, 07:25
     
    nate_02631
    rank:
    Professional Professional
    registered:
     September 2003
    Status:
    offline
    last visit:
    11.04.08
    Posts:
    3055
    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...

Extensions Moderation

Main Menu

Extensions Database

Documentation

Development

Login

Donate to Zikula