zoukankan      html  css  js  c++  java
  • SharePoint XSLT Demo

    <xsl:template name="TemplateNmae" match="Row[@Style=TemplateNmae']" mode="itemstyle">
      <xsl:param name="CurPos" />
      <xsl:param name="AOI"/>
      <xsl:variable name ="MaxRows" select ="count(//Row[contains(@Canonical,concat($AOI,';'))])"></xsl:variable>
     
      
      
       <xsl:variable name="SafeLinkUrl">
         <xsl:call-template name="OuterTemplate.GetSafeLink">
          <xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
         </xsl:call-template>
        </xsl:variable>
        <xsl:variable name="DisplayTitle">
         <xsl:call-template name="OuterTemplate.GetTitle">
          <xsl:with-param name="Title" select="@Article_Title"/>
          <xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
         </xsl:call-template>
        </xsl:variable>
     
        <xsl:variable name="LinkTarget">
         <xsl:if test="@OpenInNewWindow = 'True'" >_blank</xsl:if>
        </xsl:variable>
        
        
        <xsl:variable name="DisplayDate">
              <xsl:call-template name="Test.GetDate">
                <xsl:with-param name="Date" select="@Date"/>
        
              </xsl:call-template>
           </xsl:variable>

        
      

       
       <xsl:if test="contains(@Canonical,concat($AOI,';'))">
       
          
       <div class="elsevier_headlines">
                <ul class="medical">
                  <li>
                   
                   

         <!--
         <a  href="{$SafeLinkUrl}" target="{$LinkTarget}" title="{@LinkToolTip}">
                       <xsl:value-of select="$DisplayTitle"/>
                     </a>
                     -->
                    
                     <!-- Section to display Article Title --> 
                     <xsl:choose>
         
                <xsl:when test ="string-length(normalize-space(string($DisplayTitle)))&gt;=20">
                
                
                <a  href="{$SafeLinkUrl}" target="{$LinkTarget}" title="{@LinkToolTip}">
                <xsl:value-of select="concat(substring($DisplayTitle,1,20),'...')"/>
                </a>
                
                 </xsl:when>
                 
                <xsl:otherwise>
                
                <a  href="{$SafeLinkUrl}" target="{$LinkTarget}" title="{@LinkToolTip}">
                <xsl:value-of select="$DisplayTitle"/>
                </a>

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

                    
                    <!-- Section to display new icon per Publication date  -->
                    <xsl:if test="(normalize-space(string(@Publication_Date))='') or ((number(ddwrt:FormatDateTime(string(@Publication_Date),2052,'yyyyMMdd'))&lt;=number(ddwrt:FormatDateTime(string(ddwrt:TodayIso()),2052,'yyyyMMdd'))) and (number(ddwrt:FormatDateTime(string(@Publication_Date),2052,'yyyyMMdd'))&gt;=(number(ddwrt:FormatDateTime(string(ddwrt:TodayIso()),2052,'yyyyMMdd'))-7)))">
          
          
          <img src="/News/News/Documents/new_icon.jpg"/>
                      

         </xsl:if>
                   
         <!-- Section to display Publication date  -->
                     <span style="color:#808080;padding-left:45px">
                      <xsl:value-of select="$DisplayDate"></xsl:value-of>
            </span>
             


             
                  </li>           
                </ul>
              </div>
             
             
              <!-- Section to display List All link  -->
      <xsl:if test ="$CurPos=10 or $MaxRows=$CurPos">

            <div class="tab_head_pad weather_padding3">
              <a  href="/News/News/Pages/News.aspx" target="{$LinkTarget}" title="{@LinkToolTip}">
                显示全部
              </a>
            </div>

      </xsl:if>
             
            </xsl:if>
     
       
      
     </xsl:template>

  • 相关阅读:
    【Mysql 8001错误
    【mysql查询今天、昨天、7天、近30天、本月、上一月 数据】
    bootstrap-table 常用总结-1
    前端下载图片
    swiper 轮播中常用的效果,持续更新
    常用的时间函数整理
    拼接字符转的转义
    Ajax跨域请求,设置content
    JS MD5 返回二进制格式
    jqgrid three 树形结构
  • 原文地址:https://www.cnblogs.com/dexter2003/p/2050917.html
Copyright © 2011-2022 走看看