【问题标题】:joomla SEF shows differrent links in Homepage than inner pages !joomla SEF 在主页中显示与内页不同的链接!
【发布时间】:2010-04-01 14:23:03
【问题描述】:

我正在启用 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 转换它..?至少作为最后的手段?

【问题讨论】:

    标签: joomla joomla1.5 joomla-sef-urls


    【解决方案1】:

    当没有任何与内容相关联的 Itemid(也称为菜单项)时,第一个 SEF URL 是默认的 Joomla SEF 格式。您用于“链接到主页上的文章”的方法不是提供 Joomla 构建 /Category/141... URL 所需的 Itemid。

    如果您想要完全控制,我建议您使用另一个 SEF 管理组件,例如 AceSEF 或 sh404SEF,它们往往会为 URL 管理提供更多控制。

    【讨论】:

      【解决方案2】:

      如果您想删除控制器部分,您可以获取默认菜单项并将其 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;
      }
      

      【讨论】:

        猜你喜欢
        • 2010-10-18
        • 1970-01-01
        • 2013-02-07
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2022-11-17
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多