Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Page Properties
hiddentrue
idKB


ThemeLinking
Type

Hide

Available from
 


The following example shows you how you can stop the Show on Map link from appearing beside every Doctor and Dentist displayed from NHS Choices. It will display some results such as the contact details just not an identifiable location.

...

Code Block
title*Fields.xsl - Larger extraceextract
collapsetrue
.......
 
<!--v3.4 new template to generate the Dist column-->
<xsl:template name="getDist">
   <xsl:param name="cur"/>
      <td>
            <xsl:for-each select="$cur/child::node()[
               name(.) != 'Obj' 
               and name(.) != 'Key' 
               and name(.) != 'URL' 
               and name(.) != 'MI_Style' 
               and name(.) != 'MapSpurE' 
               and name(.) != 'MapSpurN' 
               and name(.) != 'MapSpurMinE'
               and name(.) != 'MapSpurMinN'
               and name(.) != 'MapSpurMaxE'
               and name(.) != 'MapSpurMaxN'
               and name(.) != 'MapSpurX' 
               and name(.) != 'MapSpurY'
               and name(.) != ''
               ]">   
                        <xsl:choose>
                           <xsl:when  test="name(.) = 'Distance'">
                              <xsl:variable name="dist" select="."/>
                              <xsl:variable name="e" select="$cur/child::node()[name(.) = 'MapSpurE']"/>
                              <xsl:variable name="n" select="$cur/child::node()[name(.) = 'MapSpurN']"/>
                              <xsl:if test="$dist != -1">
                                <p class="atDistance">
 
                                 <strong>Distance: </strong>
                                 <xsl:choose>
                                    <xsl:when test="$dist > 1000">
                                       <xsl:value-of select="round($dist div 1000)" />
                                       km away
                                    </xsl:when>
                                    <xsl:otherwise>
                                       <xsl:value-of select="round($dist)" />
                                          metres away
                                    </xsl:otherwise>
 
                                 </xsl:choose>
                                </p>
                              </xsl:if>
                              <!-- don't do for NHS CHoices -->
                              <xsl:if test="$mapLayers != 'Dentists' and $mapLayers != 'Doctors'">
                              <p>
                                 <a>
                                    <xsl:attribute name="href">
                                       
                                       <xsl:choose>
                                          
                                          <xsl:when test="$dist != -1">
                                             <xsl:value-of select="$mapPageUrl" />?MapSource=<xsl:value-of select="$mapSource" />&amp;amp;StartEasting=<xsl:value-of select="$e" />&amp;amp;StartNorthing=<xsl:value-of select="$n" />&amp;amp;StartZoom=250&amp;amp;o=1&amp;amp;Layers=<xsl:value-of select="$mapLayers" />
                                          </xsl:when>
                                          <xsl:otherwise>
                                             <xsl:value-of select="$mapPageUrl" />?MapSource=<xsl:value-of select="$mapSource" />&amp;amp;StartEasting=<xsl:value-of select="$e" />&amp;amp;StartNorthing=<xsl:value-of select="$n" />&amp;amp;StartZoom=1100&amp;amp;o=1&amp;amp;Layers=<xsl:value-of select="$mapLayers" />
                                          </xsl:otherwise>
                                       </xsl:choose>
                                    </xsl:attribute>
                                    <xsl:attribute name="class">atShowOnMap</xsl:attribute>Show  <xsl:choose>
                                       <xsl:when test="contains($cur/child::node()[position()=1],'|')">
                                          <xsl:value-of select="substring-after($cur/child::node()[position()=1],'|')"/>
                                       </xsl:when>
                                       <xsl:otherwise>
                                          <xsl:value-of select="$cur/child::node()[position()=1]"/>
                                       </xsl:otherwise>
                                    </xsl:choose>
                                    on map  
                                 </a>
                              </p>
                              </xsl:if>
                           </xsl:when>
                           <xsl:otherwise>
                           </xsl:otherwise>
 
                        </xsl:choose>
            </xsl:for-each>
   </td>                        
 
</xsl:template>
 
.....

...