Custom component - URL issue when doing multi-lang + SEF - Joomla! Forum - community, help and support


hi everybody.

first, let me apologize if i'm not posting @ right place, hesitating between components, languages , sef part of forum, indeed believe it's component development issue side.

so, have url issue specific development environment :
- joomla installation on subfolder (http://my-domain/my-subfolder)
- sef enabled
- multi-languages enabled


i wrote simple custom component, show on public side :
- list of (let's say) categories.
- when click category, go second view.
nothing complicated, 2 views & models stuff, working well.

i have activated sef, , wrote simple router.php file in component's public site, , it's working well:

code: select all

function mycustomcomponentbuildroute(&$query) {
    $segments = array();
    if (isset($query['category'])) {
        $segments[] = 'category';
        $segments[] = $query['category'];
        unset($query['category']);
    }
    unset($query['view']);
    return $segments;
}

function mycustomcomponentparseroute($segments) {
    $vars = array();
    // count segments
    $count = count($segments);
    if (in_array('category', $segments)) {
        $vars['view'] = 'category';
        $vars['category'] = $segments[$count - 1];
    }
    else {
        $vars['view'] = 'mycustomcomponent';
    }
    return $vars;
}


finally, have activated multi-languages, , that's bug.

to access component, made menu item, , set languages.
so url component's categories list either:

code: select all

- http://my-domain/mysubfolder/index.php/en/menu-item-alias
- http://my-domain/mysubfolder/index.php/fr/menu-item-alias


for categories, links follow :

code: select all

- http://my-domain/mysubfolder/index.php/en/menu-item-alias/category/categoryname


my issue when click on category (previous link), resulting url on browser's url bar truncated this:

code: select all

http://my-domain/mysubfolder/index.php/en/ias/category/categoryname

so page show error.php template...

what have found part truncated menu item alias.
and truncated length of subfolder's name + "/".
so example "mysubfolder/" 12 chars. "menu-item-alias" alias truncated "ias".

here's have tested make work:
- disable sef
- disable multi-languages

on production's install, there no subfolder joomla, seems works fine (done quick test): custom component, sef activated, multi-lang activated.
but wish test on dev environnement ?

many read entire post, , me on investigations :-[






Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support