Index: /main/trunk/model-sites-dev/heritage-nz/collect/pdf-reports/etc/collectionConfig.xml
===================================================================
--- /main/trunk/model-sites-dev/heritage-nz/collect/pdf-reports/etc/collectionConfig.xml	(revision 33365)
+++ /main/trunk/model-sites-dev/heritage-nz/collect/pdf-reports/etc/collectionConfig.xml	(revision 33366)
@@ -56,4 +56,71 @@
 			</gsf:choose-metadata>
 		</gsf:template>
+
+		<gsf:template name="document-node-display">
+		    <xsl:variable name="clNode"><xsl:value-of select="/page/pageRequest/paramList/param[@name = 'cl']/@value"/></xsl:variable>
+		    <xsl:variable name="SourceFile"><xsl:value-of disable-output-escaping="yes" 
+		                  select="metadataList/metadata[@name='SourceFile']" /></xsl:variable>
+
+		    <gsf:switch>
+		      <gsf:metadata name="Plugin"/>
+		      <gsf:when test="equals" test-value="CSVPlugin">
+			<td valign="top">
+			  <gsf:link type="document">
+			    <gsf:icon type="document"/>
+			  </gsf:link>
+			</td>
+			<td valign="top">
+			  <gsf:link type="document">
+			    <xsl:if test="starts-with($clNode,'CL5')"> 
+			      <i><gsf:metadata name="AuthorityNo"/>:</i> 
+			    </xsl:if>
+			    <xsl:if test="starts-with($clNode,'CL6')"> 
+			      <i><gsf:metadata name="SiteNo"/>:</i> 
+			    </xsl:if>
+
+			    <xsl:call-template name="choose-title"/>
+
+			    <gsf:switch>
+			      <gsf:metadata name="Date"/>
+			      <gsf:when test="exists">&#160;<i>(<gsf:metadata name="Date"/>)</i></gsf:when>
+			    </gsf:switch>
+
+			  </gsf:link>
+			</td>
+			
+		      </gsf:when>
+		      <gsf:otherwise>
+			<td valign="top">
+			  <gsf:link type="source" target="_blank" onclick="gtag_trigger_download_event(this,'{$SourceFile}');">
+			    <gsf:choose-metadata>
+			      <gsf:metadata name="thumbicon"/>
+			      <gsf:metadata name="srcicon"/>
+			    </gsf:choose-metadata>
+			  </gsf:link>						
+			</td>
+			<td valign="top">
+			  <gsf:link type="document">
+			    <xsl:if test="starts-with($clNode,'CL5')"> 
+			      <i><gsf:metadata name="AuthorityNo"/>:</i> 
+			    </xsl:if>
+			    <xsl:if test="starts-with($clNode,'CL6')"> 
+			      <i><gsf:metadata name="SiteNo"/>:</i> 
+			    </xsl:if>
+
+			    <xsl:call-template name="choose-title"/>
+
+			    <gsf:switch>
+			      <gsf:metadata name="Date"/>
+			      <gsf:when test="exists">&#160;<i>(<gsf:metadata name="Date"/>)</i></gsf:when>
+			    </gsf:switch>
+
+			  </gsf:link>
+			</td>
+				
+		      </gsf:otherwise>
+		    </gsf:switch>
+		    
+		</gsf:template>
+
 	</format>
 	<search type="solr">
@@ -121,47 +188,7 @@
 		
 		<format>
-			<gsf:template match="documentNode">
-
-			  <gsf:switch>
-			    <gsf:metadata name="Plugin"/>
-			    <gsf:when test="equals" test-value="CSVPlugin">
-				<td valign="top">
-					<gsf:link type="document">
-						<gsf:icon type="document"/>
-					</gsf:link>
-				</td>
-				<td>
-					<gsf:link type="document">
-						<xsl:call-template name="choose-title"/>
-					</gsf:link>
-				</td>
-
-			    </gsf:when>
-			    <gsf:otherwise>
-			      <td valign="top">
-<!--				
-				        <gsf:link type="document">
-						<gsf:icon type="document"/>
-						</gsf:link>
--->						
-
-					<gsf:link type="source">
-						<gsf:choose-metadata>
-							<gsf:metadata name="thumbicon"/>
-							<gsf:metadata name="srcicon"/>
-						</gsf:choose-metadata>
-					</gsf:link>						
-				</td>
-				<td>
-					<gsf:link type="document">
-						<xsl:call-template name="choose-title"/>
-					</gsf:link>
-				</td>
-
-			    </gsf:otherwise>
-			  </gsf:switch>
-
-
-			</gsf:template>
+		  <gsf:template match="documentNode">
+		    <xsl:call-template name="document-node-display"/>
+		  </gsf:template>
 		</format>
 	</search>
@@ -360,40 +387,5 @@
 		<format>
 		  <gsf:template match="documentNode">
-
-		    <gsf:switch>
-		      <gsf:metadata name="Plugin"/>
-		      <gsf:when test="equals" test-value="CSVPlugin">
-			<td valign="top">
-			  <gsf:link type="document">
-			    <gsf:icon type="document"/>
-			  </gsf:link>
-			</td>
-			<td valign="top">
-			  <gsf:link type="document">
-			    <!-- Defined in the global format statement -->
-			    <i><!--Authority Number --><gsf:metadata name="AuthorityNo"/>:</i> <xsl:call-template name="choose-title"/>
-			  </gsf:link>
-			</td>
-			
-		      </gsf:when>
-		      <gsf:otherwise>
-			<td valign="top">
-			  <gsf:link type="source">
-			    <gsf:choose-metadata>
-			      <gsf:metadata name="thumbicon"/>
-			      <gsf:metadata name="srcicon"/>
-			    </gsf:choose-metadata>
-			  </gsf:link>						
-			</td>
-			<td valign="top">
-			  <gsf:link type="document">
-			    <!-- Defined in the global format statement -->
-			    <i><!-- Authority Number --><gsf:metadata name="AuthorityNo"/>:</i> <xsl:call-template name="choose-title"/>
-			  </gsf:link>
-			</td>
-				
-		      </gsf:otherwise>
-		    </gsf:switch>
-		    
+		    <xsl:call-template name="document-node-display"/>
 		  </gsf:template>
 		</format>
@@ -416,40 +408,5 @@
 		<format>
 		  <gsf:template match="documentNode">
-
-		    <gsf:switch>
-		      <gsf:metadata name="Plugin"/>
-		      <gsf:when test="equals" test-value="CSVPlugin">
-			<td valign="top">
-			  <gsf:link type="document">
-			    <gsf:icon type="document"/>
-			  </gsf:link>
-			</td>
-			<td valign="top">
-			  <gsf:link type="document">
-			    <!-- Defined in the global format statement -->
-			    <i><!--NZAA Site Number --><gsf:metadata name="SiteNo"/>:</i> <xsl:call-template name="choose-title"/>
-			  </gsf:link>
-			</td>
-			
-		      </gsf:when>
-		      <gsf:otherwise>
-			<td valign="top">
-			  <gsf:link type="source">
-			    <gsf:choose-metadata>
-			      <gsf:metadata name="thumbicon"/>
-			      <gsf:metadata name="srcicon"/>
-			    </gsf:choose-metadata>
-			  </gsf:link>						
-			</td>
-			<td valign="top">
-			  <gsf:link type="document">
-			    <!-- Defined in the global format statement -->
-			    <i><!-- NZAA Site Number --><gsf:metadata name="SiteNo"/>:</i> <xsl:call-template name="choose-title"/>
-			  </gsf:link>
-			</td>
-				
-		      </gsf:otherwise>
-		    </gsf:switch>
-		    
+		    <xsl:call-template name="document-node-display"/>
 		  </gsf:template>
 		</format>
@@ -459,53 +416,5 @@
 		<format>
 		  <gsf:template match="documentNode">
-		    
-		    <gsf:switch>
-		      <gsf:metadata name="Plugin"/>
-		      <gsf:when test="equals" test-value="CSVPlugin">
-			<td valign="top">
-			  <gsf:link type="document">
-			    <gsf:icon type="document"/>
-			  </gsf:link>
-			</td>
-			<td valign="top">
-			  <gsf:link type="document">
-			    <!-- Defined in the global format statement -->
-			    <xsl:call-template name="choose-title"/>
-			    <gsf:switch>
-			      <gsf:metadata name="Date"/>
-			      <gsf:when test="exists">&#160;<i>(<gsf:metadata name="Date"/>)</i></gsf:when>
-			    </gsf:switch>
-			  </gsf:link>
-			</td>
-			
-		      </gsf:when>
-		      <gsf:otherwise>
-			<td valign="top">
-			  <!--
-			      <gsf:link type="document">
-			        <gsf:icon type="document"/>
-			      </gsf:link>
--->					  
-
-			  <gsf:link type="source">
-			    <gsf:choose-metadata>
-			      <gsf:metadata name="thumbicon"/>
-			      <gsf:metadata name="srcicon"/>
-			    </gsf:choose-metadata>
-			  </gsf:link>						
-			</td>
-			<td valign="top">
-			  <gsf:link type="document">
-			    <!-- Defined in the global format statement -->
-			    <xsl:call-template name="choose-title"/>
-			    <gsf:switch>
-			      <gsf:metadata name="Date"/>
-			      <gsf:when test="exists">&#160;<i>(<gsf:metadata name="Date"/>)</i></gsf:when>
-			    </gsf:switch>
-			  </gsf:link>
-			</td>
-			
-		      </gsf:otherwise>
-		    </gsf:switch>
+		    <xsl:call-template name="document-node-display"/>
 		  </gsf:template>
 		  
@@ -657,8 +566,13 @@
 					  </xsl:template>
 					  -->
-					  
 					  <xsl:variable name="SourceFile"><xsl:value-of disable-output-escaping="yes" 
 					     select="/page/pageResponse/document/metadataList/metadata[@name='SourceFile']" /></xsl:variable>
+<!--
 					  <gsf:link type="source" downloadXXX="{$SourceFile}">
+-->
+<!--
+					  <gsf:link type="source" target="_blank" onclick="_gaq.push(['_trackEvent','Download','PDF',this.href]);'">
+-->
+					  <gsf:link type="source" target="_blank" onclick="gtag_trigger_download_event(this,'{$SourceFile}');">
 					    
 					    <!--
