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>

  • 相关阅读:
    C# 监测每个方法的执行次数和占用时间(测试1)
    C# 依赖注入那些事儿
    SQL Server GROUP BY 后 拼接 字符串
    C# 根据Excel生成树
    C# 反射赋值
    C# 集合转换为DataTable
    Oracle 未能加载文件或程序集Oracle.DataAccess
    MySQL 各种主流 SQLServer 迁移到 MySQL 工具对比
    平衡树
    数据结构优化dp
  • 原文地址:https://www.cnblogs.com/dexter2003/p/2050917.html
Copyright © 2011-2022 走看看