Pages enfant
  • Afficher un seul canal

En uPortal 3.2

1) custom/uPortal/uportal-war/src/main/resources/layout/theme/universality/navigation.xsl

--- navigation.xsl.orig 2010-10-16 04:14:27.000000000 +0200
+++ navigation.xsl      2011-03-01 09:26:28.000000000 +0100
@@ -123,9 +123,27 @@
     </xsl:variable>
     
     <li id="portalNavigation_{@ID}"> <!-- Each navigation menu item.  The unique ID can be used in the CSS to give each menu item a unique icon, color, or presentation. -->
-      <a id="tabLink_{@ID}" href="{$BASE_ACTION_URL}?uP_root=root&amp;uP_sparam=activeTab&amp;activeTab={position()}" title="{@name}">  <!-- Navigation item link. -->
+      <!-- NANCY2 START : DISPLAY ONLY ONE CHANNEL -->
+         <xsl:variable name="firstChanID" select="tabChannel[1]/@ID"/>
+         <xsl:choose>
+        <xsl:when test="$AUTHENTICATED='true' and normalize-space(.) != $firstChanID">
+                       <xsl:variable name="firstChanURL"><xsl:value-of select="$BASE_ACTION_URL"/>?uP_sparam=activeTab&amp;activeTab=<xsl:value-of select="position()"/>&amp;uP_root=<xsl:value-of select="$firstChanID"/></xsl:variable>
+                       <a id="tabLink_{@ID}" href="{$firstChanURL}" title="{@name}">  <!-- Navigation item link. -->
+                               <span><xsl:value-of select="@name"/></span>
+                       </a>
+               </xsl:when>
+        <xsl:otherwise>
+                       <a id="tabLink_{@ID}" href="{$BASE_ACTION_URL}?uP_root=root&amp;uP_sparam=activeTab&amp;activeTab={position()}" title="{@name}">  <!-- Navigation item link. -->
+                               <span><xsl:value-of select="@name"/></span>
+                       </a>
+               </xsl:otherwise>
+      </xsl:choose>
+      <!--
+      <a id="tabLink_{@ID}" href="{$BASE_ACTION_URL}?uP_root=root&amp;uP_sparam=activeTab&amp;activeTab={position()}" title="{@name}">
         <span><xsl:value-of select="@name"/></span>
       </a>
+      -->
+      <!-- NANCY2 END : DISPLAY ONLY ONE CHANNEL -->     
       <xsl:if test="@activeTab='true' and $CONTEXT='sidebar'"> <!-- If navigation is being rendered in the sidebar rather than as tabs, call template for rendering active menu item's submenu. -->
         <xsl:call-template name="subnavigation">
           <xsl:with-param name="CONTEXT" select="'subnav'"/>
@@ -138,8 +156,10 @@
           <xsl:with-param name="TAB_POSITION" select="position()"/>
         </xsl:call-template>
       </xsl:if>
-      <xsl:if test="$USE_AJAX='true' and $AUTHENTICATED='true' and @activeTab='true' and not($PORTAL_VIEW='focused')"> <!-- If navigation is being rendered in the sidebar rather than as tabs, call template for rendering active menu item's submenu. -->
-        <xsl:call-template name="preferences.editpage"/>
+      <!-- NANCY2 END : DISPLAY ONLY ONE CHANNEL -->
+         <!-- <xsl:if test="$USE_AJAX='true' and $AUTHENTICATED='true' and @activeTab='true' and not($PORTAL_VIEW='focused')"> --><!-- If navigation is being rendered in the sidebar rather than as tabs, call template for rendering active menu item's submenu. -->
+      <xsl:if test="$USE_AJAX='true' and $AUTHENTICATED='true' and @activeTab='true'">
+         <xsl:call-template name="preferences.editpage"/>
       </xsl:if>
     </li>

2) custom/uPortal/uportal-war/src/main/resources/layout/theme/universality/columns.xsl

dans le template : <xsl:template name="columns">

remplacer : <xsl:apply-templates select="channel"/>
par : <xsl:apply-templates select="channel[1]"/>

Avant uPortal 3.2

  • Comment permettre l'affichage du premier canal lorsqu'on clique sur un onglet ?
    La solution consiste à modifier le fichier "navigation.xsl" :

Remplacer le code suivant (ligne 109-119) dans la partie TEMPLATE: NAVIGATION TABS

<li id="portalNavigation_{@ID}" class="portal-navigation {$NAV_POSITION} {$NAV_ACTIVE} {$NAV_MOVABLE}"> <\!-\- Each navigation menu item.&nbsp; The unique ID can be used in the CSS to give each menu item a uni$
  <a id="tabLink_{@ID}" href="{$BASE_ACTION_URL}?uP_root=root&amp;uP_sparam=activeTab&amp;activeTab={position()}" title="{@name}" class="portal-navigation-link">&nbsp; <\!-\- Navigation item link. \-->
    <span class="portal-navigation-label"><xsl:value-of select="@name"/></span>
  </a>
  <xsl:if test="@activeTab='true' and $CONTEXT='sidebar'"> <\!-\- If navigation is being rendered in the sidebar rather than as tabs, call template for rendering active menu item's submenu. \-->
    <xsl:call-template name="subnavigation">
      <xsl:with-param name="CONTEXT" select="'subnav'"/>
      <xsl:with-param name="TAB_POSITION" select="position()"/>
    </xsl:call-template>
  </xsl:if>
</li>

Par :

<xsl:variable name="numChannel" select="./tabChannel[1]/@ID"/>
  <li id="portalNavigation_{@ID}" class="portal-navigation {$NAV_POSITION} {$NAV_ACTIVE} {$NAV_MOVABLE}"> <!-- Each navigation menu item.  The unique ID can be used in the CSS to give each menu item a unique icon, color, or presentation. -->
    <xsl:choose>
      <xsl:when test="@name = 'Mon Dossier'">
        <a id="tabLink_{@ID}" href="{$BASE_ACTION_URL}?uP_root={$numChannel}&amp;uP_sparam=activeTab&amp;activeTab={position()}" title="{@name}" class="portal-navigation-link">  <!-- Navigation item link. -->
          <span class="portal-navigation-label"><xsl:value-of select="@name"/></span></a>
      </xsl:when>
      <xsl:otherwise>
        <a id="tabLink_{@ID}" href="{$BASE_ACTION_URL}?uP_root=root&amp;uP_sparam=activeTab&amp;activeTab={position()}" title="{@name}" class="portal-navigation-link">  <!-- Navigation item link. -->
        <span class="portal-navigation-label"><xsl:value-of select="@name"/></span></a>
      </xsl:otherwise>
    </xsl:choose>
      <xsl:if test="@activeTab='true' and $CONTEXT='sidebar'"> <!-- If navigation is being rendered in the sidebar rather than as tabs, call template for rendering active menu item's submenu. -->
        <xsl:call-template name="subnavigation">
          <xsl:with-param name="CONTEXT" select="'subnav'"/>
          <xsl:with-param name="TAB_POSITION" select="position()"/>
        </xsl:call-template>
      </xsl:if>
  </li>

Dans cette exemple, lorsqu'on cliquera sur l'onglet "Mon Dossier", uniquement le premier canal sera chargé. Pour tous les autres onglets, il chargera les différents canaux.

Il est possible d'en ajouter d'autres en modifiant la condition du test.

  • Aucune étiquette