i have a problem with my joomla component seo url building.
i have links like:
$link = JRoute::_( 'index.php?option=com_expose$view=expose&id='.$result->id );
$link2 = JRoute::_( 'index.php?option=com_expose$view=search' );
The seo url looks like:
www.domain.com/component/expose/123 www.domain.com/component/search
How can i now make my own alias for the url ? I want somethink like this:
www.domain.com/expose/the-beautiful-page
Without the component and with a title for the id.
by router.php looks like:
function ExposeBuildRoute( &$query )
{
$segments = array();
if(isset($query['view']))
{
$segments[] = $query['view'];
unset( $query['view'] );
}
if(isset($query['id']))
{
$segments[] = $query['id'];
unset( $query['id'] );
};
return $segments;
}
function ExposeParseRoute( $segments )
{
$vars = array();
switch($segments[0])
{
case 'search':
$vars['view'] = 'search';
$id = explode( ':', $segments[1] );
$vars['id'] = (int) $id[0];
break;
case 'expose':
$vars['view'] = 'expose';
$id = explode( ':', $segments[1] );
$vars['id'] = (int) $id[0];
break;
}
return $vars;
}
What must be done, to remove the /component/ alias and replace the id with the right title.
Big thanks.