Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • timmieboy Friend
    #199252

    Hello,

    It seems that for a multilanguage site the url of the newest job module is not changing into correct language.

    This is what happens:

    Dutch url – nl/nieuwe-jobs/jaview/42-sales-assistant

    EN url – en/nieuwe-jobs/jaview/42-sales-assistant
    Needs to be: en/newest-jobs/jaview/42-sales-assistant

    German url – de/nieuwe-jobs/jaview/42-sales-assistant
    Needs to be: de/neue-stelle/jaview/42-sales-assistant

    The menu item of the default language always stays in the url instead of the language menu name

    Thanh Nguyen Viet Friend
    #540573

    Hello,

    To resolve this issue, please try the following steps:

    In this file: components/com_jajobboard/helper/jafunctions.class.php

    Find the code snippet that defines a function get_Itemid

    And replace it with the one below:
    [PHP]function get_Itemid($find = array()) {
    $app = JFactory::getApplication();
    $menus = $app->getMenu();
    $items = $menus->getMenu();
    $lang = JFactory::getLanguage();

    foreach ($items as $item) {
    if (!is_object($item))
    {
    continue;
    }

    $test = true;
    foreach($find as $attr => $value) {
    if(!isset($item->query[$attr]) || $item->query[$attr] != $value) {
    $test = false;
    break;
    }
    }
    if($test && ($item->language == ‘*’ || $item->language == $lang->getTag())) {
    return $item->id;
    }
    }

    return 0;
    }[/PHP]

    This update helps to get correct menu item in current active language, so it can help to get correct url.

Viewing 2 posts - 1 through 2 (of 2 total)

This topic contains 2 replies, has 2 voices, and was last updated by  Thanh Nguyen Viet 10 years, 4 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum