内容查询Web部件样式,隔行变色。
来源:互联网 发布:轩辕剑神骑进阶数据 编辑:程序博客网 时间:2024/06/06 02:12
首先要修改ContentQueryMain.xsl文件,在OuterTemplate.CallItemTemplate节点下修改
<xsl:otherwise>
<xsl:apply-templates select="." mode="itemstyle">
<xsl:with-param name="CurPos" select="$Position" />
</xsl:apply-templates>
</xsl:otherwise>
然后就可以在ItemStyle.xsl文件中使用这个CurPos参数取得行号了
<xsl:template name="KXLF" match="Row[@Style='KXLF']" mode="itemstyle">
<xsl:param name="CurPos" />
<xsl:variable name="SafeImageUrl">
<xsl:call-template name="OuterTemplate.GetSafeStaticUrl">
<xsl:with-param name="UrlColumnName" select="'ImageUrl'"/>
</xsl:call-template>
</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="@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:choose>
<xsl:when test="$CurPos mod 2 = 1">
<table cellpadding="0" cellspacing="0" border="0" width="100%" bgcolor="#FFFFFF">
<tr height="18px">
<td width="3px"></td>
<td width="5px">
<img src="/_Layouts/Bingo/Images/li_img.gif"></img>
</td>
<td width="3px"></td>
<td width="*">
<a href="{$SafeLinkUrl}" target="_blank" title="{@SorD}">
<acronym title="{$DisplayTitle}">
<font color="#232D50">
1<xsl:value-of select="substring($DisplayTitle,1,11)"/>...
</font>
</acronym>
</a>
</td>
<td width="80px" align="center" style="white-space:nowrap;overflow:hidden;" >
<nobr>
<xsl:value-of select="substring-before(@Created,' ')"/>
</nobr>
</td>
</tr>
</table> </xsl:when>
<xsl:otherwise>
<table cellpadding="0" cellspacing="0" border="0" width="100%" bgcolor="#e3efff">
<tr height="18px">
<td width="3px"></td>
<td width="5px">
<img src="/_Layouts/Bingo/Images/li_img.gif"></img>
</td>
<td width="3px"></td>
<td width="*">
<a href="{$SafeLinkUrl}" target="_blank" title="{@SorD}">
<acronym title="{$DisplayTitle}">
<font color="#232D50">
2<xsl:value-of select="substring($DisplayTitle,1,11)"/>...
</font>
</acronym>
</a>
</td>
<td width="80px" align="center" style="white-space:nowrap;overflow:hidden;" >
<nobr>
<xsl:value-of select="substring-before(@Created,' ')"/>
</nobr>
</td>
</tr>
</table>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
- 内容查询Web部件样式,隔行变色。
- 表格样式:隔行变色
- HTML 表格的CSS样式-隔行变色
- CSS表格样式:圆角,隔行,变色
- 实现查询分页以及隔行变色
- sharepoint 2007 内容查询web部件 如何显示信息日期
- 隔行变色
- 隔行变色
- 隔行变色
- 隔行变色
- 隔行变色
- 隔行变色
- 隔行变色
- 隔行变色
- 隔行变色
- 隔行变色
- 隔行变色
- 隔行变色
- 教你如何刻录极品CD音乐碟
- TTIME FORMATL SAMPLE
- 用svn和Rsync和php做本地开发环境、测试服务器、远程服务器同步和更新
- Inserting TTime values in Symbian DB using SQL..
- Maven安装
- 内容查询Web部件样式,隔行变色。
- 《技术出身,如何做好项目经理》系列之《从技术人员到项目经理三年中的一些思考》
- 无奈的90后,80后,70后,60后,50后
- C#数据导出到Excel方法汇总
- 《技术出身,如何做好项目经理》系列之《理想中的项目经理》
- Google文件系统(Google File System)论文
- 删除 Symbian 模拟器中的图标
- 文件和目录的操作
- rsyncd.conf - 正确设置gid参数