2010-04-01 57 views
1

我使的Joomla SEF,並得到下面的結果,當我從一個網頁(頭版)的文章鏈接到一篇文章:joomla SEF顯示主頁上的內容不同於內部頁面!

anywebsite.com/component/content/article/26/141-Z1-Z2- Z3,Z4

而是從其他文章鏈接時,我得到了我想要的結果是:

anywebsite.com/Categor/141-Z1-Z2-Z3-Z4

和鏈接既是等於:

index .php?option = com_content & view = article & id = 141:Z1-Z2-Z3-Z4 & catid = 26 任何想法?

編輯:手動鏈接這個SEF鏈接是一個好主意,而不是等待joomla轉換它..?至少作爲最後的手段?

回答

1

當沒有任何Itemid(又名菜單項)與內容關聯時,第一個SEF URL是默認的Joomla SEF格式。你用來「鏈接到hompage的文章」沒有提供Joomla需要構建/ Category/141 ... URL的Itemid。

如果您想完全控制,我會建議您使用另一個SEF管理​​組件,如AceSEF或sh404SEF,它們傾向於爲URL管理提供更多控制。

0

如果你想刪除控制器部分,你可以得到默認的菜單項,並將它的id從你的路由器中查詢到。

在你的路由器:

if (!isset($query['Itemid']) { 
    $app =& JFactory::getApplication(); 
    $menu =& $app->getMenu(); 
    $item =& $menu->getActive(); 

    // Do a check to see if $item is set to something. If no active item, get the default: 

    if (!$item) $item =& $menu->getDefault(); 

    $query['Itemid'] = $item->id; 
} 
相關問題