内容查询Web部件显示有关问题
内容查询Web部件显示问题?
我在页面添加了一个内容查询Web部件,并且把它导出在桌面进行修改里面的代码,主要是修改了:
<property name="CommonViewFields" type="string"> Title,text;_x79d1__x5ba4_,text;_x4e13__x4e1a__x6280__x672f_,Note;_x6807__x9898_,text;_x8bf4__x660e_,Note
</property>
(Note换成text也是一样的效果——结果一样)。
再在ItemStyle.xsl样式里面写入一个自己的样式:
<xsl:template name="Zhuan_Style" match="Row[@Style='Zhuan_Style']" mode="itemstyle">
<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="SafeImageUrl">
<xsl:call-template name="OuterTemplate.GetSafeStaticUrl">
<xsl:with-param name="UrlColumnName" select="'ImageUrl'"/>
</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 id="linkitem" class="item">
<xsl:if test="string-length($SafeImageUrl) != 0">
<div class="image-area-left">
<a href="{$SafeLinkUrl}" target="{$LinkTarget}">
<img class="image" src="{$SafeImageUrl}" alt="{@ImageUrlAltText}" />
</a>
</div>
</xsl:if>
<div class="link-item" style="margin-top:0px;">
<xsl:call-template name="OuterTemplate.CallPresenceStatusIconTemplate"/>
<table style="width: 95%; line-height:22px; margin-top:0px; text-align:left">
<tr>
<td style="width:20px;">
<img src="_layouts/images/square.gif"/>
</td>
<td>
<table style="width:90%">
<tr>
<td width="50%">姓名:
<a href="{$SafeLinkUrl}" target="{$LinkTarget}" title="{@LinkToolTip}">
<xsl:value-of select="$DisplayTitle"/>
</a>
</td>
<td>所属科室:<xsl:value-of select="@_x79d1__x5ba4_"/></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
</td>
<td>专业:<xsl:value-of select="@_x4e13__x4e1a__x6280__x672f_"/></td>
</tr>
<tr>
<td>
</td>
<td><div style="text-overflow:ellipsis">简介:<xsl:value-of select="@_x79d1__x5ba4_"/>
<a href="{$SafeLinkUrl}" target="{$LinkTarget}" title="{@LinkToolTip}" style="color:red">
更多>>>
</a></div>
<div style="text-align:right; text-overflow:ellipsis"></div></td>
</tr>
</table>
</div>
</div>
</xsl:template>
最后在界面导入这个修改后的内容查询Web部件,并且在内容样式里面选择我自己的样式(Zhuan_Style),但是最后界面显示的效果确实只有姓名可以显示,其它都不能显示,请问这是怎么回事?
------解决方案--------------------
我在页面添加了一个内容查询Web部件,并且把它导出在桌面进行修改里面的代码,主要是修改了:
<property name="CommonViewFields" type="string"> Title,text;_x79d1__x5ba4_,text;_x4e13__x4e1a__x6280__x672f_,Note;_x6807__x9898_,text;_x8bf4__x660e_,Note
</property>
(Note换成text也是一样的效果——结果一样)。
再在ItemStyle.xsl样式里面写入一个自己的样式:
<xsl:template name="Zhuan_Style" match="Row[@Style='Zhuan_Style']" mode="itemstyle">
<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="SafeImageUrl">
<xsl:call-template name="OuterTemplate.GetSafeStaticUrl">
<xsl:with-param name="UrlColumnName" select="'ImageUrl'"/>
</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 id="linkitem" class="item">
<xsl:if test="string-length($SafeImageUrl) != 0">
<div class="image-area-left">
<a href="{$SafeLinkUrl}" target="{$LinkTarget}">
<img class="image" src="{$SafeImageUrl}" alt="{@ImageUrlAltText}" />
</a>
</div>
</xsl:if>
<div class="link-item" style="margin-top:0px;">
<xsl:call-template name="OuterTemplate.CallPresenceStatusIconTemplate"/>
<table style="width: 95%; line-height:22px; margin-top:0px; text-align:left">
<tr>
<td style="width:20px;">
<img src="_layouts/images/square.gif"/>
</td>
<td>
<table style="width:90%">
<tr>
<td width="50%">姓名:
<a href="{$SafeLinkUrl}" target="{$LinkTarget}" title="{@LinkToolTip}">
<xsl:value-of select="$DisplayTitle"/>
</a>
</td>
<td>所属科室:<xsl:value-of select="@_x79d1__x5ba4_"/></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
</td>
<td>专业:<xsl:value-of select="@_x4e13__x4e1a__x6280__x672f_"/></td>
</tr>
<tr>
<td>
</td>
<td><div style="text-overflow:ellipsis">简介:<xsl:value-of select="@_x79d1__x5ba4_"/>
<a href="{$SafeLinkUrl}" target="{$LinkTarget}" title="{@LinkToolTip}" style="color:red">
更多>>>
</a></div>
<div style="text-align:right; text-overflow:ellipsis"></div></td>
</tr>
</table>
</div>
</div>
</xsl:template>
最后在界面导入这个修改后的内容查询Web部件,并且在内容样式里面选择我自己的样式(Zhuan_Style),但是最后界面显示的效果确实只有姓名可以显示,其它都不能显示,请问这是怎么回事?
------解决方案--------------------