定制导航

使用动态内容点来确定“顶部”、“主要”和“辅助”导航显示的内容。使用 navigation.jsp 文件将属性映射到 theme.html 文件中的动态内容点标识。呈示导航通过使用具有 <ul><li> 标记的单一 JSP 文件完成。

主题中存在提供的导航级别:

导航的顶级、主要级别和辅助级别
顶级 - 项 1
显示直接位于内容根下的页面的链接,例如“主页”、“管理”和“应用程序”。使用 dyn-cs:id:85theme_topNav 显示“顶级”导航:
   <div class="wpthemeHeader">
      ...
      <a rel="dynamic-content" href="dyn-cs:id:85theme_topNav"></a>
      ...
   </div>
主要 - 项 2
显示当前选择的顶层页面的子页面的链接,例如“主页”中的“入门”和“功能”。使用 dyn-cs:id:85theme_primaryNav 显示“主要”导航:
   <div class="wpthemeBanner">
      ...
      <a rel="dynamic-content" href="dyn-cs:id:85theme_primaryNav"></a>
      ...
   </div>
次要 - 项 3
显示当前选择的主要页面的子页面的链接。使用 dyn-cs:id:85theme_secondaryNav 显示“主要”导航:
   <div class="wpthemeSecondaryBanner">
      ...
      <a rel="dynamic-content" href="dyn-cs:id:85theme_secondaryNav"></a>
      ...
   </div>
面包屑 - 项 4
显示当前 Web 页面在 Web 站点中的位置,以及返回到站点框架最高级别的逻辑路径。面包屑跟踪从内容根开始,一直延续到当前选定的静态页面。
侧边
显示当前选择的顶层页面的子页面和三级页面的链接。缺省情况下,此模板应用于门户网站的“管理”部分。
   <div class="wpthemeSideNavigation wpthemeLeft" role="navigation">
      ...
      <a rel="dynamic-content" href="dyn-cs:id:85theme_sideNav"></a>
      ...
   </div>
移动
仅在移动设备(例如,智能手机和平板电脑)上显示当前选择的顶层页面的子页面和三级页面的链接。用户单击时,每个导航级别会延迟加载到页面中。
<div class="wpthemeBanner">
      ...      
      <a rel="dynamic-content" href="dyn-cs:id:85theme_mobileNav"></a>      
      ...   
</div>

要关闭延迟加载移动导航,使用 85theme_mobileNav_static 动态内容点替换 85theme_mobileNav 动态内容点。

<div class="wpthemeBanner">      ...     
          <a rel="dynamic-content"
    href="dyn-cs:id:85theme_mobileNav_static"></a>            ...  
    </div>

导航内容点

内容点标识映射到 PortalServer_root\theme\wp.theme.themes\default85\installedApps\DefaultTheme85.ear\DefaultTheme85.war\WEB-INF\plugin.xml 文件中的 wp_dynamicContentSpots_85 模块子添加项。

表 1. 内容点属性名。
名称
85theme_topNav

mvc:smartphone/tablet@res:{war:context-root}/themes/html/dynamicSpots/navigation.jsp?type=top

85theme_primaryNav

mvc:res:{war:context-root}/themes/html/dynamicSpots/navigation.jsp?type=primary,smartphone@,tablet@

85theme_secondaryNav

mvc:res:{war:context-root}/themes/html/dynamicSpots/navigation.jsp?type=secondary,smartphone@,tablet@

85theme_sideNav

mvc:res:{war:context-root}/themes/html/dynamicSpots/sideNavigation.jsp?startLevel=2,smartphone@,tablet@

85theme_mobileNav

mvc:smartphone/tablet@res:{war:context-root}/themes/html/dynamicSpots/mobileNavigation.jspmvc:smartphone/tablet@res:{war:context-root}/themes/html/dynamicSpots/lazyMobileNavigation.jsp?context={war:context-root}

子添加项 URI 值指示在内容点中装入了哪个 JSP。对于这三个水平导航点,同一 navigation.jsp 文件将与传递到 JSP 的另一参数配合使用。navigation.jsp 文件位于 PortalServer_root\theme\wp.theme.themes\default85\installedApps\DefaultTheme85.ear\DefaultTheme85.war\themes\html\dynamicSpots 文件夹中。此参数是 type 的键,具有三个可能的值:
顶级
使导航 JSP 呈现顶级导航,从页面导航中的级别 0(最高级)开始。
主要
使导航 JSP 呈现主要导航,从页面导航中的级别 1 开始。
次要
使导航 JSP 呈现次要导航,从页面导航中的级别 2 开始。

在主题的 theme.html 文件中,可以除去缺省的导航动态内容点。接着,可以将动态内容点替换为指向您自己的 JSP 实现的映射。例如,可以将三个顶级导航替换为单一顶级导航和单一侧边导航。