开发者

Make Joomla component compatible with SEF/SEO

Hi I have developed a custom component for Joomla 1.5. However the urls when SEF is turned on 开发者_运维百科could look a bit better e.g. display the title rather than the id, how can I make custom urls for my component when SEF for Joomla is turned on?


Have you looked in to the Joomla routing methods? http://docs.joomla.org/Routing


You Can use JRoute class as follows:

JRoute::_( $url, $xhtml = true, $ssl=null );

$url is a string containing the absolute or relative internal Joomla! URL.

$xhtml is a boolean value that specifies whether or not the output should be in XHTML. This parameter is optional and if omitted defaults to true.

$ssl is an integer value that specifies whether the URI should be secure. It should be set to 1 to force the URI to be secure using the global secure site URI, 0 to leave it in the same state as when it was passed, and -1 to force the URI to be unsecure using the global unsecure site URI.

The most important parameter is $url. A call to this method might look like:

JRoute::_( 'index.php?view=article&id='.$[itemID] );
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜