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# webapi 在swagger里添加全局过滤器
    axios get,post请求时带headers
    svn"重新定位"提示版本库uuid不匹配
    DevExpress XtraReport
    DevExpress GridControl List绑定方式下新增行的方法
    对Dev的GridControl/GridView控件进行分组并展开操作
    DevExpress GridControl控件行内新增、编辑、删除添加选择框
    JavaScript 中的FileReader对象(实现上传图片预览)
    数据库连接情况查询
    C#代码中实现两个表(DataTable)的关联查询(JOIN)
  • 原文地址:https://www.cnblogs.com/dexter2003/p/2050917.html
Copyright © 2011-2022 走看看