Anpassen des XSLT: left_column_navigation.xsl an neues Design

"Roger Fischer" <[email protected]>
Newsgroups gmane.comp.cms.bitflux.general.german
Message-ID <[email protected]>
Hi

Patrick passt jetzt das XSLT-File "left_column_navigation.xsl" ans neue
Design von Miss Monorom an.
Vorerst nur mal die linke Navigation, d.h. Hierarchiestufen 2 und 3 (Levels
5 und 6).
Das File left_column_navigation.xsl befindet sich im Ordner $PROJECT_DIR/xsl

Hier noch das bisherige File "left_column_navigation.xsl". Patrick postet
dann auch das neue.
Gruss
Roger


<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="iso-8859-1" indent="no"
doctype-public="-//W3C//DTD HTML 4.0 Transitional//EN"/>


<xsl:template name="left_column_navigation">

<td valign="top" align="left">
	 <table width="220" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><img src="/images/blind.gif" width="6" height="1"/></td>
            <td><img src="/images/blind.gif" width="9" height="8"/></td>
            <td><img src="/images/blind.gif" width="1" height="7"/></td>
            <td><img src="/images/blind.gif" width="15" height="1"/></td>
          </tr>
		  <xsl:if test="number($thisTreeSection/level) &gt; 3">
		  <xsl:call-template name="treenavi">
		  <!-- startlevel is the level, where the navigation should start... -->
		  	<xsl:with-param name="startLevel" select="5"/>
		  </xsl:call-template>
		  </xsl:if>
        </table>
</td>

</xsl:template>

<xsl:template name="treenavi">
	<xsl:param name="startLevel"/>

	<xsl:call-template name="onelevel">
		<xsl:with-param name="level" select="$startLevel "/>
	</xsl:call-template>

</xsl:template>

<xsl:template name="onelevel">
	<xsl:param name="level"/>
<!-- topnode = parentnode (maybe)-->
	<xsl:variable name="topnode" select="/iba/tree/Section[(l &lt;
$thisTreeSection/l and r &gt; $thisTreeSection/r and level  =
$level -1 )]"/>
<!-- previous siblings -->
	<xsl:for-each select="/iba/tree/Section[(((l &gt; $topnode/l and r &lt;=
$thisTreeSection/r) or (l &lt; $thisTreeSection/l and r &gt;=
$thisTreeSection/r))  and level  = $topnode/level + 1 and button = 1 )]">
		<xsl:call-template name="printCacheId"/>
		<xsl:call-template name="menuPunkte">
			<xsl:with-param name="punkte" select="."/>
		</xsl:call-template>
	</xsl:for-each>
	<xsl:choose>
<!-- if we are at a higher level, than the level of the called section do
"onelevel" again -->
		 <xsl:when test="$level &lt; $thisTreeSection/level">
			 <xsl:call-template name="onelevel">
				 <xsl:with-param name="level" select="$level + 1"/>
			 </xsl:call-template>
		 </xsl:when>
<!-- otherwise print the children of the choosen document and stop the
recursion-->
		 <xsl:otherwise>
			 <xsl:for-each select="/iba/tree/Section[(l &gt; $thisTreeSection/l and r
&lt;= $thisTreeSection/r and level  = $thisTreeSection/level + 1) and button
= 1]">
				 <xsl:call-template name="printCacheId"/>
	        	  <xsl:call-template name="menuPunkte">
        	 		 <xsl:with-param name="punkte" select="."/>
            	  </xsl:call-template>
        	 </xsl:for-each>
		 </xsl:otherwise>
	</xsl:choose>
<!-- following siblings -->
	<xsl:for-each select="/iba/tree/Section[(l &gt; $thisTreeSection/l and r
&lt; $topnode/r and level  = $topnode/level + 1)]">
		<xsl:call-template name="printCacheId"/>
	    <xsl:call-template name="menuPunkte">
       		<xsl:with-param name="punkte" select="."/>
			<xsl:with-param name="after" select="'yes'"/>
        </xsl:call-template>
	</xsl:for-each>

</xsl:template>
<!-- in "menuPunkte" you define, how the single menupoints should be
rendered -->
<xsl:template name="menuPunkte">
	<xsl:param name="punkte"/>
	<!-- $after is set to yes, if the item is a following sibling -->
	<xsl:param name="after" select="'no'"/>

		<xsl:call-template name="printCacheId"/>
		<xsl:choose>
		<!-- if level 4, do it differently -->
			<xsl:when test="level &lt;= 4">
				<xsl:if test="position() != 1 or $after='yes'">
					<tr>
			            <td><img src="/images/blind.gif" width="6" height="10"/></td>
            			<td><img src="/images/blind.gif" width="9" height="1"/></td>
			            <td><img src="/images/blind.gif" width="115"
height="1"/></td>
            			<td><img src="/images/blind.gif" width="15" height="1"/></td>
		            </tr>
          			<tr>
			            <td><img src="/images/blind.gif" width="6" height="1" /></td>
            			<td><img src="/images/blind.gif" width="9" height="1"/></td>
			            <td><img src="/images/sub_linie.gif" width="115"
height="1"/></td>
            			<td><img src="/images/blind.gif" width="15" height="1"/></td>
			        </tr>

          			<tr>
			            <td><img src="/images/blind.gif" width="6" height="7"/></td>
            			<td><img src="/images/blind.gif" width="9" height="1"/></td>
            			<td><img src="/images/blind.gif" width="115"
height="1"/></td>
            			<td><img src="/images/blind.gif" width="15" height="1"/></td>
          			</tr>
				</xsl:if>
				<xsl:choose>
					<xsl:when test="l &lt;= $thisTreeSection/l and r &gt;=
$thisTreeSection/r">
					     <tr>
        				    <td><img src="/images/blind.gif" width="6" height="1"/></td>
            				<td><img src="/images/sub_pfeil.gif" width="9"
height="13"/></td>
		            		<td class="linkblaunav"><a
href="/{$langDir}{fulluri}/"><xsl:value-of
select="title/*[name()=$lang]"/></a></td>
				            <td><img src="/images/blind.gif" width="15"
height="1"/></td>
			        	  </tr>
					</xsl:when>
					<xsl:otherwise>
			          <tr>
				            <td><img src="/images/blind.gif" width="6" height="1"/></td>
	        			    <td><img src="/images/blind.gif" width="9" height="1"/></td>
				            <td class="graunavigation"><a
href="/{$langDir}{fulluri}/"><xsl:value-of
select="title/*[name()=$lang]"/></a></td>
				            <td><img src="/images/blind.gif" width="15"
height="1"/></td>
			          </tr>
					</xsl:otherwise>
				</xsl:choose>

			</xsl:when>
			<xsl:otherwise>
				<tr><td colspan="4" >

				<table width="220" cellpadding="0" cellspacing="0" >
				<xsl:choose>
        			<xsl:when test="$thisTreeSection/ID = ID">

					   <tr>
					    <td><img src="/images/blind.gif" width="15" height="1"/></td>
			            <td><img src="/images/blind.gif" width="115"
height="1"/></td>
            			<td><img src="/images/blind.gif" width="15" height="1"/></td>

			           </tr>

			          	<tr>
            				<td ><img src="/images/blind.gif" width="{((number(level) -
5) * 16) + 9}" height="8"/></td>
				            <td class="linkblaunavAkt"><a
href="/{$langDir}{fulluri}/">&#187;&#160;<xsl:value-of
select="title/*[name()=$lang]"/></a></td>
				            <td><img src="/images/blind.gif" width="15"
height="8"/></td>
				         </tr>
            		</xsl:when>
	        		<xsl:otherwise>

			 			  <tr>
					    <td><img src="/images/blind.gif" width="15" height="1"/></td>
			            <td><img src="/images/blind.gif" width="115"
height="1"/></td>
            			<td><img src="/images/blind.gif" width="15" height="1"/></td>

			           </tr>
          				<tr>
            				<td ><img src="/images/blind.gif" width="{((number(level) -
5) * 16) + 9}" height="8"/></td>
            				<td class="graunavigation"><a
href="/{$langDir}{fulluri}/">&#187;&#160;<xsl:value-of
select="title/*[name()=$lang]"/></a></td>
            				<td><img src="/images/blind.gif" width="15"
height="1"/></td>
          				</tr>
            		</xsl:otherwise>
				</xsl:choose>
				</table></td></tr>

			</xsl:otherwise>
		</xsl:choose>

</xsl:template>
</xsl:stylesheet>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.