增加内容查询部件的显示字段
2009-08-28 09:23
316 查看
<xsl:template name="MyStyle" match="Row[@Style='MyStyle']" mode="itemstyle">
<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>
<div class="link-item">
<xsl:call-template name="OuterTemplate.CallPresenceStatusIconTemplate"/>
<table style="width: 95%">
<tr>
<td><img src="_layouts/images/square.gif"/></td>
<td style="width: 50%">
<a href="{$SafeLinkUrl}" target="{$LinkTarget}" title="{@LinkToolTip}">
<xsl:value-of select="$DisplayTitle"/>
</a>
</td>
<td style="width: 20%" align="left">
<xsl:value-of select="@Author" />
</td>
<td align="left">
<div class="description">
<xsl:value-of select="@Modified" />
</div>
</td>
</tr>
</table>
</div>
</xsl:template>
然后在内容查询部件上如下设置:
<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>
<div class="link-item">
<xsl:call-template name="OuterTemplate.CallPresenceStatusIconTemplate"/>
<table style="width: 95%">
<tr>
<td><img src="_layouts/images/square.gif"/></td>
<td style="width: 50%">
<a href="{$SafeLinkUrl}" target="{$LinkTarget}" title="{@LinkToolTip}">
<xsl:value-of select="$DisplayTitle"/>
</a>
</td>
<td style="width: 20%" align="left">
<xsl:value-of select="@Author" />
</td>
<td align="left">
<div class="description">
<xsl:value-of select="@Modified" />
</div>
</td>
</tr>
</table>
</div>
</xsl:template>
然后在内容查询部件上如下设置:
![](http://images.cnblogs.com/cnblogs_com/hary/%E6%9C%AA%E5%91%BD%E5%90%8D.jpg)
相关文章推荐
- sharepoint 2007 内容查询web部件 如何显示信息日期
- ISA发布MOSS网站内容查询WEB部件不能显示问题?
- 再谈联合查询注入字段间编码不同无法显示内容问题
- [MOSS 译]如何:在WEB内容查询部件中使用自定义的字段
- [乐意黎原创]Mysql 查询字段时强制区分大小写及在某字段左或右边增加内容
- [实例] 简单搞定联合查询注入字段间编码不同无法显示内容问题
- PL/SQL Oracle 用sql query查询,中文字段内容显示异常的处理
- 查询SQL中的text类型字段内容,让其显示完整
- 修改MOSS2007内容查询部件实现自定义格式显示
- 2006-4-21 ASP 判断 URL 查询字段, 显示相关内容 by Stabx
- MySQL查询根据名字段重复内容只显示最新的一条
- ASP 判断 URL 查询字段, 显示相关内容
- easyui-datagrid行编辑,后台以主表为基表关联从表进行查询数据后,在前台行编辑字段内容的显示
- 内容查询部件在登陆不登陆的不同显示情况
- MySQL 一表中字段内容是用逗号分隔的 另一表含有对应数据的两表联合查询
- [译]SharePoint 2007 SDK:使用属性来自定义内容查询WEB部件
- Ajax实现在textbox中输入内容,动态从数据库中模糊查询显示到下拉框中
- MySQL数据库中字段设置了zerofill,页面上显示时整数前仍带有0以及如何查询字段注释
- hive查询如何显示查询的字段
- hive查询如何显示查询的字段