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:
finally, have activated multi-languages, , that's bug.
to access component, made menu item, , set languages.
so url component's categories list either:
for categories, links follow :
my issue when click on category (previous link), resulting url on browser's url bar truncated this:
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
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-aliasfor categories, links follow :
code: select all
- http://my-domain/mysubfolder/index.php/en/menu-item-alias/category/categorynamemy 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/categorynameso 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
Post a Comment